index.dev.js 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import React from 'react'
  2. import ReactDOM from 'react-dom'
  3. import PopinFixed from './component/PopinFixed/PopinFixed.jsx'
  4. import PopinFixedHeader from './component/PopinFixed/PopinFixedHeader.jsx'
  5. import PopinFixedOption from './component/PopinFixed/PopinFixedOption.jsx'
  6. import PopinFixedContent from './component/PopinFixed/PopinFixedContent.jsx'
  7. import TextAreaApp from './component/Input/TextAreaApp/TextAreaApp.jsx'
  8. import BtnSwitch from './component/Input/BtnSwitch/BtnSwitch.jsx'
  9. import Checkbox from './component/Input/Checkbox.jsx'
  10. import Timeline from './component/Timeline/Timeline.jsx'
  11. import TimelineDebugData from './component/Timeline/debugData.js'
  12. import Delimiter from './component/Delimiter/Delimiter.jsx'
  13. import CardPopup from './component/CardPopup/CardPopup.jsx'
  14. import CardPopupCreateContent from './component/CardPopup/CardPopupCreateContent.jsx'
  15. import { libGenerateAvatarFromPublicName } from './helper.js'
  16. import NewVersionButton from './component/OptionComponent/NewVersionBtn.jsx'
  17. import ArchiveDeleteContent from './component/OptionComponent/ArchiveDeleteContent.jsx'
  18. ReactDOM.render(
  19. <div style={{width: '1200px'}}>
  20. <PopinFixed customClass={`${'randomClass'}`}>
  21. <PopinFixedHeader
  22. customClass={`${'randomClass'}`}
  23. faIcon={'fa fa-file-word-o'}
  24. name={'test exemple'}
  25. onClickCloseBtn={() => {}}
  26. />
  27. <PopinFixedOption
  28. customClass={`${'randomClass'}`}
  29. onClickNewVersionBtn={() => {}}
  30. selectedStatus={{
  31. label: 'Open',
  32. slug: 'open',
  33. faIcon: 'square-o',
  34. hexcolor: '#3f52e3',
  35. globalStatus: 'open'
  36. }}
  37. availableStatus={[{
  38. label: 'Open',
  39. slug: 'open',
  40. faIcon: 'square-o',
  41. hexcolor: '#3f52e3',
  42. globalStatus: 'open'
  43. }, {
  44. label: 'Validated',
  45. slug: 'closed-validated',
  46. faIcon: 'check-square-o',
  47. hexcolor: '#008000',
  48. globalStatus: 'closed'
  49. }, {
  50. label: 'Cancelled',
  51. slug: 'closed-unvalidated',
  52. faIcon: 'close',
  53. hexcolor: '#f63434',
  54. globalStatus: 'closed'
  55. }, {
  56. label: 'Deprecated',
  57. slug: 'closed-deprecated',
  58. faIcon: 'warning',
  59. hexcolor: '#ababab',
  60. globalStatus: 'closed'
  61. }]}
  62. onChangeStatus={newStatus => console.log('newStatus', newStatus)}
  63. onClickArchive={() => console.log('btn archive clicked')}
  64. onClickDelete={() => console.log('btn delete clicked')}
  65. />
  66. <PopinFixedContent customClass={`${'randomClass'}__contentpage`}>
  67. <Timeline
  68. showHeader={false}
  69. customClass={`${'randomClass'}__contentpage`}
  70. customColor={'#3f52e3'}
  71. loggedUser={{
  72. user_id: 1,
  73. username: 'Smoi',
  74. firstname: 'Côme',
  75. lastname: 'Stoilenom',
  76. email: 'osef@algoo.fr',
  77. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4'
  78. }}
  79. timelineData={TimelineDebugData.map(item => item.timelineType === 'comment'
  80. ? {
  81. ...item,
  82. author: {
  83. ...item.author,
  84. avatar_url: item.author.avatar_url
  85. ? item.author.avatar_url
  86. : libGenerateAvatarFromPublicName(item.author.public_name)
  87. }
  88. }
  89. : item
  90. )}
  91. newComment={''}
  92. disableComment={false}
  93. wysiwyg={false}
  94. onChangeNewComment={() => {}}
  95. onClickValidateNewCommentBtn={() => {}}
  96. onClickWysiwygBtn={() => {}}
  97. onClickRevisionBtn={() => {}}
  98. shouldScrollToBottom={true}
  99. />
  100. </PopinFixedContent>
  101. </PopinFixed>
  102. </div>
  103. , document.getElementById('content')
  104. )