index.dev.js 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. <div>
  68. <NewVersionButton customColor='#3f52e3' />
  69. <ArchiveDeleteContent customColor='#3f52e3' />
  70. <Delimiter />
  71. <span>Here will be the app content. Style is handled by the app (obviously)</span>
  72. <BtnSwitch />
  73. {/* <TextAreaApp customClass={'randomClass'} text={'woot'} /> */}
  74. <Checkbox
  75. name='osef'
  76. onClickCheckbox={() => {}}
  77. checked
  78. />
  79. </div>
  80. <Timeline
  81. customClass={`${'randomClass'}__contentpage`}
  82. customColor={'#3f52e3'}
  83. loggedUser={{
  84. user_id: 1,
  85. username: 'Smoi',
  86. firstname: 'Côme',
  87. lastname: 'Stoilenom',
  88. email: 'osef@algoo.fr',
  89. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4'
  90. }}
  91. timelineData={TimelineDebugData.map(item => item.timelineType === 'comment'
  92. ? {
  93. ...item,
  94. author: {
  95. ...item.author,
  96. avatar_url: item.author.avatar_url
  97. ? item.author.avatar_url
  98. : libGenerateAvatarFromPublicName(item.author.public_name)
  99. }
  100. }
  101. : item
  102. )}
  103. newComment={''}
  104. disableComment={false}
  105. wysiwyg={false}
  106. onChangeNewComment={() => {}}
  107. onClickValidateNewCommentBtn={() => {}}
  108. onClickWysiwygBtn={() => {}}
  109. onClickRevisionBtn={() => {}}
  110. shouldScrollToBottom={true}
  111. />
  112. </PopinFixedContent>
  113. </PopinFixed>
  114. </div>
  115. , document.getElementById('content')
  116. )