Advertisement
Guest User

Untitled

a guest
Apr 29th, 2015
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. [task] Design a friends list view and implement it with HTML/CSS/JavaScript/react.js
  2.  
  3. You have basic HTML/CSS and JavaScript knowlegde and want to contribute to Retroshare?
  4. Here is a small project with clearly defined scope. It should costs you not more than one or two weeks/weekends.
  5. It is perfect for new contributors.
  6.  
  7. The peers list of the new webinterface was made quick&dirty, just to show that the backend works. As result, the list is implemented as table with columns like avatar, name, locations. It does not fit on small screens and it looks ugly.
  8.  
  9. A new react component should be made which satisfies the following requirements:
  10. - show name, avatar image, locations, online state
  11. - fits on mobile phone screen
  12. - easy to see which friends are online and which are not
  13.  
  14. The component takes JavScript list as input, and generates the HTML with react.js
  15.  
  16. maybe:
  17. - implement filter to show only online friends
  18. - sort friends list by name
  19.  
  20. areas for research:
  21. - long-tap menu for mobile phones, or context menu for desktop
  22.  
  23.  
  24. More notes below:
  25. -------------------------------------------------------------------------
  26. Component to display the friends list
  27. (see also Peers2 in retroshare-svn/trunk/libresapi/webui/gui.jsx)
  28.  
  29. goals:
  30. - make it easy to see which friend is online
  31. - make the layout fit to the narrow screen of a mobile phone
  32.  
  33. var Peers3 = React.createClass({
  34. // AutoUpdateMixin: fetches the data and sets this.state
  35. // SignalSlotMixin: to send commands to other components with this.emit
  36. mixins: [AutoUpdateMixin, SignalSlotMixin],
  37. // called by AutoUpdateMixin, defines which data to fetch
  38. getPath: function(){return "peers";},
  39. // called by react when component is created
  40. getInitialState: function(){
  41. return {data: []};
  42. },
  43. // event handler for an "add friend" button
  44. add_friend_handler: function(){
  45. this.emit("change_url", {url: "add_friend"});
  46. },
  47. // called by react
  48. render: function(){
  49. return <div>{/*TODO: generate html to display this.state*/}</div>;
  50. },
  51. });
  52.  
  53.  
  54. The data in this.state.data looks like this:
  55. [{
  56. "locations": [{
  57. "avatar_address": "/asdf/avatar_image",
  58. "groups": null,
  59. "is_online": false,
  60. "location": "home",
  61. "name": "max",
  62. "peer_id": "asdf",
  63. "pgp_id": "yxcv"
  64. },
  65. ... more locations ...
  66. ],
  67. "name": "max",
  68. "pgp_id": "yxcv"
  69. },
  70. ... more peers ...
  71. ]
  72.  
  73.  
  74. other components:
  75. downloads
  76. - i'm not very happy about the unfriendly big numbers. better use KB, MB, GB
  77. - visualize the download progress with a progress bar
  78. - move actions to a context menue or to a long-tap menue on mobile devices?
  79.  
  80. search
  81. - display previous searches (path=filesearch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement