WorkingGroup.stories.tsx 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import React from 'react';
  2. import { boolean, number, text, withKnobs } from '@storybook/addon-knobs';
  3. import { u128, GenericAccountId } from '@polkadot/types';
  4. import { MemberId } from '@joystream/types/members';
  5. import { ContentCurators } from '@polkadot/joy-roles/tabs/WorkingGroup';
  6. import { GroupMember } from '../elements';
  7. import { mockProfile } from '../mocks';
  8. import 'semantic-ui-css/semantic.min.css';
  9. import '@polkadot/joy-roles/index.sass';
  10. import { WorkingGroups } from '../working_groups';
  11. export default {
  12. title: 'Roles / Components / Working groups tab',
  13. decorators: [withKnobs]
  14. };
  15. export function ContentCuratorsSection () {
  16. const members: GroupMember[] = [
  17. {
  18. memberId: new MemberId(1),
  19. roleAccount: new GenericAccountId('5HZ6GtaeyxagLynPryM7ZnmLzoWFePKuDrkb4AT8rT4pU1fp'),
  20. profile: mockProfile(
  21. text('Handle', 'benholdencrowther', 'Ben'),
  22. text('Avatar URL', 'https://www.benholdencrowther.com/wp-content/uploads/2019/03/Hanging_Gardens_of_Babylon.jpg', 'Ben')
  23. ),
  24. title: text('Title', 'Curation lead', 'Ben'),
  25. stake: new u128(number('Stake', 10101, {}, 'Ben')),
  26. workerId: 1,
  27. group: WorkingGroups.ContentCurators
  28. },
  29. {
  30. memberId: new MemberId(2),
  31. roleAccount: new GenericAccountId('5DfJWGbBAH8hLAg8rcRYZW5BEZbE4BJeCQKoxUeqoyewLSew'),
  32. profile: mockProfile(text('Handle', 'bwhm0', 'Martin')),
  33. title: text('Title', 'Content curator', 'Martin'),
  34. stake: new u128(number('Stake', 10101, {}, 'Martin')),
  35. workerId: 2,
  36. group: WorkingGroups.ContentCurators
  37. },
  38. {
  39. memberId: new MemberId(3),
  40. roleAccount: new GenericAccountId('5DQqNWRFPruFs9YKheVMqxUbqoXeMzAWfVfcJgzuia7NA3D3'),
  41. profile: mockProfile(
  42. 'yourheropaul',
  43. 'https://yhp.io/img/paul.svg'
  44. ),
  45. title: text('Title', 'Content curator', 'Paul'),
  46. stake: new u128(number('Stake', 10101, {}, 'Paul')),
  47. workerId: 3,
  48. group: WorkingGroups.ContentCurators
  49. },
  50. {
  51. memberId: new MemberId(4),
  52. roleAccount: new GenericAccountId('5GSMNn8Sy8k64mGUWPDafjMZu9bQNX26GujbBQ1LeJpNbrfg'),
  53. profile: mockProfile(
  54. 'alex_joystream',
  55. 'https://avatars2.githubusercontent.com/u/153928?s=200&v=4'
  56. ),
  57. title: text('Title', 'Content curator', 'Alex'),
  58. stake: new u128(number('Stake', 10101, {}, 'Alex')),
  59. workerId: 4,
  60. group: WorkingGroups.ContentCurators
  61. },
  62. {
  63. memberId: new MemberId(5),
  64. roleAccount: new GenericAccountId('5Gn9n7SDJ7VgHqHQWYzkSA4vX6DCmS5TFWdHxikTXp9b4L32'),
  65. profile: mockProfile(
  66. 'mokhtar',
  67. 'https://avatars2.githubusercontent.com/u/1621012?s=460&v=4'
  68. ),
  69. title: text('Title', 'Content curator', 'Mokhtar'),
  70. stake: new u128(number('Stake', 10101, {}, 'Mokhtar')),
  71. workerId: 5,
  72. group: WorkingGroups.ContentCurators
  73. }
  74. ];
  75. return (
  76. <ContentCurators workers={members} workerRolesAvailable={boolean('Roles available', true)} />
  77. );
  78. }