@mohamed-karawia/library 0.1.21 → 0.1.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. package/dist/index.js +26 -26
  2. package/dist/stories/Chat/Chat.js +24 -31
  3. package/dist/stories/Community/Community.js +54 -34
  4. package/dist/stories/Events/Event/Event.js +12 -4
  5. package/dist/stories/Events/EventsList/EventsList.js +14 -7
  6. package/dist/stories/Forms/AddPhoto/AddPhoto.js +8 -7
  7. package/dist/stories/Forms/CreateEvent/CreateEvent.js +115 -0
  8. package/dist/stories/Forms/CreateFolder/CreateFolder.js +87 -0
  9. package/dist/stories/Forms/CreateSong/CreateSong.js +98 -0
  10. package/dist/stories/Library/Folders/Folders.js +27 -17
  11. package/dist/stories/Library/Notes/Notes.js +29 -18
  12. package/dist/stories/Modals/AddPhotoAlbum/AddPhotoAlbum.js +38 -0
  13. package/dist/stories/Modals/AddPhotoModal/AddPhotoModal.js +40 -0
  14. package/dist/stories/Modals/AddSongModal/AddSongModal.js +41 -0
  15. package/dist/stories/Modals/AddVideoAlbumModal/AddVideoAlbumModal.js +41 -0
  16. package/dist/stories/Modals/AddVideoModal/AddVideoModal.js +39 -0
  17. package/dist/stories/Modals/ChatConfigModal/ChatContifgModal.js +93 -0
  18. package/dist/stories/Modals/CreateEventModal/CreateEventModal.js +42 -0
  19. package/dist/stories/Modals/CreateFolderModal/CreateFolderModal.js +36 -0
  20. package/dist/stories/Modals/CreateMusicAlbumModal/CreateMusicAlbumModal.js +41 -0
  21. package/dist/stories/Modals/CreateNoteModal/CreateNoteModal.js +42 -0
  22. package/dist/stories/Modals/EventConfigModal/EventConfigModal.js +99 -0
  23. package/dist/stories/Modals/EventsConfigModal/EventsConfigModal.js +87 -0
  24. package/dist/stories/Modals/FoldersConfigModal/FoldersConfigModal.js +87 -0
  25. package/dist/stories/Modals/MusicAlbumConfigModal/MusicAlbumConfigModal.js +88 -0
  26. package/dist/stories/Modals/MusicAlbumsConfigModal/MusicAlbumsConfigModal.js +87 -0
  27. package/dist/stories/Modals/NotesConfigModal/NotesConfigModal.js +87 -0
  28. package/dist/stories/Modals/PhotoAlbumConfigModal/PhotoAlbumConfigModal.js +88 -0
  29. package/dist/stories/Modals/PhotoAlbumsConfigModal/PhotoAlbumsConfigModal.js +88 -0
  30. package/dist/stories/Modals/ShowImgModal/ShowImgModal.js +62 -0
  31. package/dist/stories/Modals/VideoAlbumConfigModal/VideoAlbumConfigModal.js +88 -0
  32. package/dist/stories/Modals/VideoAlbumsConfigModal/VideoAlbumsConfigModal.js +89 -0
  33. package/dist/stories/Modals/VideoConfigModal/VideoConfigModal.js +99 -0
  34. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +8 -44
  35. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +57 -37
  36. package/dist/stories/Pages/Chat/Chat.js +1 -1
  37. package/dist/stories/Pages/Events/Event/Event.js +1 -1
  38. package/dist/stories/Pages/Events/Events/Events.js +1 -1
  39. package/dist/stories/Pages/Library/Folders/Library.js +2 -2
  40. package/dist/stories/Pages/Library/Notes/Notes.js +2 -2
  41. package/dist/stories/Pages/Music/MusicAlbum/Music.js +2 -2
  42. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -2
  43. package/dist/stories/Pages/Photos/Album/Album.js +2 -2
  44. package/dist/stories/Pages/Photos/Albums/Albums.js +2 -2
  45. package/dist/stories/Pages/Video/DetailedVideo/DetailedVideo.js +2 -2
  46. package/dist/stories/Pages/Video/VideoAlbum/Video.js +2 -2
  47. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +26 -16
  48. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +11 -4
  49. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +7 -5
  50. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +7 -5
  51. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +7 -5
  52. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +7 -5
  53. package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +6 -4
  54. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +8 -7
  55. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +7 -5
  56. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +7 -5
  57. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +7 -5
  58. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +7 -5
  59. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +7 -5
  60. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +7 -5
  61. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +7 -5
  62. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +7 -5
  63. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +7 -5
  64. package/dist/stories/Reusable Components/Comments/Comments.js +58 -0
  65. package/dist/stories/Reusable Components/Community/Community.js +12 -34
  66. package/dist/stories/Reusable Components/Sections/Sections.js +67 -0
  67. package/dist/stories/Spaces/Chat/Chat.js +103 -0
  68. package/dist/stories/Spaces/EventsList/EventsList.js +140 -0
  69. package/dist/stories/Spaces/NotesList/NotesList.js +144 -0
  70. package/dist/stories/Spaces/ViewDetailedPhoto/ViewDetailedPhoto.js +24 -0
  71. package/dist/stories/Spaces/ViewEvent/Event.js +146 -0
  72. package/dist/stories/Spaces/ViewFolders/ViewFolders.js +136 -0
  73. package/dist/stories/Spaces/ViewMusicAlbumList/ViewMusicAlbumList.js +136 -0
  74. package/dist/stories/Spaces/ViewMusicAlbums/ViewMusicAlbums.js +130 -0
  75. package/dist/stories/Spaces/ViewNote/ViewNote.js +27 -0
  76. package/dist/stories/Spaces/ViewPhotoAlbumList/ViewPhotoAlbumList.js +231 -0
  77. package/dist/stories/Spaces/ViewPhotoAlbums/ViewPhotoAlbums.js +131 -0
  78. package/dist/stories/Spaces/ViewVideo/ViewVideo.js +169 -0
  79. package/dist/stories/Spaces/ViewVideoAlbumList/ViewVideoAlbumList.js +157 -0
  80. package/dist/stories/Spaces/ViewVideoAlbums/ViewVideoAlbums.js +164 -0
  81. package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +11 -4
  82. package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +17 -6
  83. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +24 -25
  84. package/dist/stories/Widgets/VideoPlayer/VideoPlayer.js +235 -0
  85. package/dist/stories/helpers/util.js +24 -24
  86. package/dist/stories/store/actions/actions.js +16 -0
  87. package/dist/stories/store/communities.js +27 -29
  88. package/dist/stories/store/community.js +941 -0
  89. package/dist/stories/store/store.js +9 -4
  90. package/package.json +1 -1
  91. package/src/index.js +16 -16
  92. package/src/stories/Community/Community.jsx +31 -32
  93. package/src/stories/Forms/AddPhoto/AddPhoto.jsx +72 -72
  94. package/src/stories/{Events → Forms}/CreateEvent/CreateEvent.jsx +5 -1
  95. package/src/stories/{Library → Forms}/CreateFolder/CreateFolder.jsx +0 -0
  96. package/src/stories/Forms/{AddSong/AddSong.jsx → CreateSong/CreateSong.jsx} +0 -0
  97. package/src/stories/Modals/AddPhotoAlbum/AddPhotoAlbum.jsx +27 -0
  98. package/src/stories/Modals/AddPhotoModal/AddPhotoModal.jsx +29 -0
  99. package/src/stories/Modals/AddSongModal/AddSongModal.jsx +37 -0
  100. package/src/stories/Modals/AddVideoAlbumModal/AddVideoAlbumModal.jsx +38 -0
  101. package/src/stories/Modals/AddVideoModal/AddVideoModal.jsx +35 -0
  102. package/src/stories/Modals/ChatConfigModal/ChatContifgModal.jsx +77 -0
  103. package/src/stories/Modals/CreateEventModal/CreateEventModal.jsx +30 -0
  104. package/src/stories/Modals/CreateFolderModal/CreateFolderModal.jsx +39 -0
  105. package/src/stories/Modals/CreateMusicAlbumModal/CreateMusicAlbumModal.jsx +37 -0
  106. package/src/stories/Modals/CreateNoteModal/CreateNoteModal.jsx +43 -0
  107. package/src/stories/Modals/EventConfigModal/EventConfigModal.jsx +74 -0
  108. package/src/stories/Modals/EventsConfigModal/EventsConfigModal.jsx +67 -0
  109. package/src/stories/Modals/FoldersConfigModal/FoldersConfigModal.jsx +66 -0
  110. package/src/stories/Modals/MusicAlbumConfigModal/MusicAlbumConfigModal.jsx +69 -0
  111. package/src/stories/Modals/MusicAlbumsConfigModal/MusicAlbumsConfigModal.jsx +73 -0
  112. package/src/stories/Modals/NotesConfigModal/NotesConfigModal.jsx +65 -0
  113. package/src/stories/Modals/PhotoAlbumConfigModal/PhotoAlbumConfigModal.jsx +71 -0
  114. package/src/stories/Modals/PhotoAlbumsConfigModal/PhotoAlbumsConfigModal.jsx +69 -0
  115. package/src/stories/Modals/ShowImgModal/ShowImgModal.jsx +87 -0
  116. package/src/stories/Modals/VideoAlbumConfigModal/VideoAlbumConfigModal.jsx +67 -0
  117. package/src/stories/Modals/VideoAlbumsConfigModal/VideoAlbumsConfigModal.jsx +67 -0
  118. package/src/stories/Modals/VideoConfigModal/VideoConfigModal.jsx +78 -0
  119. package/src/stories/Pages/Chat/Chat.jsx +1 -1
  120. package/src/stories/Pages/Events/Event/Event.jsx +1 -1
  121. package/src/stories/Pages/Events/Events/Events.jsx +1 -1
  122. package/src/stories/Pages/Library/Folders/Library.jsx +1 -1
  123. package/src/stories/Pages/Library/Notes/Notes.jsx +1 -1
  124. package/src/stories/Pages/Music/MusicAlbum/Music.jsx +1 -1
  125. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +1 -1
  126. package/src/stories/Pages/Photos/Album/Album.jsx +1 -1
  127. package/src/stories/Pages/Photos/Albums/Albums.jsx +1 -1
  128. package/src/stories/Pages/Video/DetailedVideo/DetailedVideo.jsx +1 -1
  129. package/src/stories/Pages/Video/VideoAlbum/Video.jsx +1 -1
  130. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +106 -104
  131. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +7 -5
  132. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +106 -104
  133. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +8 -6
  134. package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +6 -4
  135. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +13 -11
  136. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +36 -34
  137. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +18 -16
  138. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +7 -5
  139. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +105 -103
  140. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +8 -6
  141. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +10 -8
  142. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +7 -5
  143. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +7 -5
  144. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +7 -5
  145. package/src/stories/{VideoAlbum → Reusable Components}/Comments/Comments.jsx +0 -0
  146. package/src/stories/Reusable Components/Community/Community.jsx +10 -33
  147. package/src/stories/{Sections/Sections.jsx → Reusable Components/Sections/Sections.jsx } +1 -1
  148. package/src/stories/Spaces/Chat/Chat.jsx +77 -0
  149. package/src/stories/Spaces/EventsList/EventsList.jsx +118 -0
  150. package/src/stories/Spaces/NotesList/NotesList.jsx +125 -0
  151. package/src/stories/{Photo Album/DetailedPhoto/DetailedPhoto.jsx → Spaces/ViewDetailedPhoto/ViewDetailedPhoto.jsx} +1 -1
  152. package/src/stories/{Events/Event → Spaces/ViewEvent}/Event.jsx +17 -73
  153. package/src/stories/Spaces/ViewFolders/ViewFolders.jsx +122 -0
  154. package/src/stories/Spaces/ViewMusicAlbumList/ViewMusicAlbumList.jsx +118 -0
  155. package/src/stories/Spaces/ViewMusicAlbums/ViewMusicAlbums.jsx +108 -0
  156. package/src/stories/{Library → Spaces}/ViewNote/ViewNote.jsx +0 -0
  157. package/src/stories/{Photo Album/ViewAlbum/ViewAlbum.jsx → Spaces/ViewPhotoAlbumList/ViewPhotoAlbumList.jsx} +48 -134
  158. package/src/stories/{Photo Album/ViewAlbums/ViewAlbums.jsx → Spaces/ViewPhotoAlbums/ViewPhotoAlbums.jsx} +22 -54
  159. package/src/stories/{VideoAlbum/VideoSpace/VideoSpace.jsx → Spaces/ViewVideo/ViewVideo.jsx} +21 -47
  160. package/src/stories/{VideoAlbum/ViewAlbum/ViewAlbum.jsx → Spaces/ViewVideoAlbumList/ViewVideoAlbumList.jsx} +31 -78
  161. package/src/stories/{VideoAlbum/AlbumsGallery/AlbumsGallery.jsx → Spaces/ViewVideoAlbums/ViewVideoAlbums.jsx} +20 -51
  162. package/src/stories/{VideoAlbum → Widgets}/VideoPlayer/VideoPlayer.jsx +0 -0
  163. package/src/stories/helpers/util.js +13 -13
  164. package/src/stories/store/actions/actions.js +7 -0
  165. package/src/stories/store/{communities.js → community.js} +27 -29
  166. package/src/stories/store/store.js +3 -4
  167. package/src/stories/Chat/Chat.jsx +0 -148
  168. package/src/stories/Events/EventsList/EventsList.jsx +0 -180
  169. package/src/stories/Library/Folders/Folders.jsx +0 -187
  170. package/src/stories/Library/Notes/Notes.jsx +0 -161
  171. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +0 -216
  172. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +0 -152
@@ -9,117 +9,119 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
 
11
11
  const ChatPreview = (props) => {
12
- const [chatStyles, setChatStyles] = useState({});
13
- const initialValues = {
14
- headerStyles: {
15
- headerBackground: '',
16
- padding: 0,
17
- titleColor: '',
18
- titleFontSize: '',
19
- titleFontWeight: '',
20
- controlsStyles: {
21
- iconSize: '',
22
- iconColor: ''
23
- }
24
- },
25
- customCardStyles: {
26
- cardBackgroundColor: '',
27
- onHoverBackgroundColor: '',
28
- cardRadius: '',
29
- cardTitleFontSize: '',
30
- cardTitleFontWeight: '',
31
- cardTitleColor: '',
32
- cardImageRadius: '',
33
- cardDescriptionFontSize: '',
34
- cardDescriptionColor: '',
35
- cardPadding: 0,
36
- imgSize: 0,
37
- cardBorderSize: 0,
38
- cardBorderColor: 'purple',
39
- dateColor: ''
40
- }
12
+ const [chatStyles, setChatStyles] = useState({});
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
+ headerStyles: {
15
+ headerBackground: '',
16
+ padding: 0,
17
+ titleColor: '',
18
+ titleFontSize: '',
19
+ titleFontWeight: '',
20
+ controlsStyles: {
21
+ iconSize: '',
22
+ iconColor: ''
41
23
  }
24
+ },
25
+ customCardStyles: {
26
+ cardBackgroundColor: '',
27
+ onHoverBackgroundColor: '',
28
+ cardRadius: '',
29
+ cardTitleFontSize: '',
30
+ cardTitleFontWeight: '',
31
+ cardTitleColor: '',
32
+ cardImageRadius: '',
33
+ cardDescriptionFontSize: '',
34
+ cardDescriptionColor: '',
35
+ cardPadding: 0,
36
+ imgSize: 0,
37
+ cardBorderSize: 0,
38
+ cardBorderColor: 'purple',
39
+ dateColor: ''
40
+ }
41
+ }
42
42
 
43
- const sections = [
44
- {
45
- title: "Header Styles",
46
- body: [
47
- (<Picker label="Header Background" name="headerStyles.headerBackground" />),
48
- (<TextField type="number" label="Padding" name="headerStyles.padding" />),
49
- (<Picker label="Title Color" name="headerStyles.titleColor" />),
50
- (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
51
- (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
52
- (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
53
- (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
54
- ]
55
- },
56
- {
57
- title: "Card Styles",
58
- body: [
59
- (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
60
- (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
61
- (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
62
- (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
63
- (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
64
- (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
65
- (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
66
- (<TextField type="number" label="Text Font Size" name="customCardStyles.cardDescriptionFontSize" />),
67
- (<Picker label="Text Font Color" name="customCardStyles.cardDescriptionColor" />),
68
- (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
69
- (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
70
- (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
71
- (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
72
- (<Picker label="Date Color" name="customCardStyles.dateColor" />),
73
- ]
74
- },
43
+ const sections = [
44
+ {
45
+ title: "Header Styles",
46
+ body: [
47
+ (<Picker label="Header Background" name="headerStyles.headerBackground" />),
48
+ (<TextField type="number" label="Padding" name="headerStyles.padding" />),
49
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
50
+ (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
51
+ (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
52
+ (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
53
+ (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
75
54
  ]
55
+ },
56
+ {
57
+ title: "Card Styles",
58
+ body: [
59
+ (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
60
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
61
+ (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
62
+ (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
63
+ (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
64
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
65
+ (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
66
+ (<TextField type="number" label="Text Font Size" name="customCardStyles.cardDescriptionFontSize" />),
67
+ (<Picker label="Text Font Color" name="customCardStyles.cardDescriptionColor" />),
68
+ (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
69
+ (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
70
+ (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
71
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
72
+ (<Picker label="Date Color" name="customCardStyles.dateColor" />),
73
+ ]
74
+ },
75
+ ]
76
76
 
77
- const handleChange = (values) => {
78
- if(values){
79
- props.formChanged(values)
80
- setChatStyles(values)
81
- localStorage.setItem('formStyles', JSON.stringify(values))
82
- }
83
- }
84
-
85
- const submitHandler = (values) => {
86
- console.log(values);
87
- }
88
-
89
- const cancelHandler = () => {
90
- console.log('Canceled')
77
+ const handleChange = (values) => {
78
+ if (props.formChanged) {
79
+ if (values) {
80
+ props.formChanged(values)
81
+ setChatStyles(values)
82
+ localStorage.setItem('formStyles', JSON.stringify(values))
91
83
  }
84
+ }
85
+ }
86
+
87
+ const submitHandler = (values) => {
88
+ console.log(values);
89
+ }
90
+
91
+ const cancelHandler = () => {
92
+ console.log('Canceled')
93
+ }
92
94
  return (
93
95
  <Container>
94
- <Left>
95
- <ReusableForm
96
- formTitle="Chat Styles"
97
- initialValues={initialValues}
98
- sections={sections}
99
- headerStyles={{
100
- padding: 10,
101
- headerBackground: 'black',
102
- titleColor: '#ffff',
103
- }}
104
- sectionHeaderStyles={{
105
- padding: 6,
106
- headerBackground: '#FE1744',
107
- titleColor: '#ffff',
108
- }}
109
- bodyPadding={10}
110
- saveBtnText="Save"
111
- cancelBtnText="Cancel"
112
- saveBtnHandle={submitHandler}
113
- cancelHandler={cancelHandler}
114
- handleChange={handleChange}
115
- bodyRowGap={20}
116
- bodyColumnGap={10}
117
- />
118
- </Left>
119
- <Right>
120
- <Preview type={'Chat'} componentProps={props.componentProps} stylingProps={chatStyles} />
121
- </Right>
122
- </Container>
96
+ <Left>
97
+ <ReusableForm
98
+ formTitle="Chat Styles"
99
+ initialValues={initialValues}
100
+ sections={sections}
101
+ headerStyles={{
102
+ padding: 10,
103
+ headerBackground: 'black',
104
+ titleColor: '#ffff',
105
+ }}
106
+ sectionHeaderStyles={{
107
+ padding: 6,
108
+ headerBackground: '#FE1744',
109
+ titleColor: '#ffff',
110
+ }}
111
+ bodyPadding={10}
112
+ saveBtnText="Save"
113
+ cancelBtnText="Cancel"
114
+ saveBtnHandle={submitHandler}
115
+ cancelHandler={cancelHandler}
116
+ handleChange={handleChange}
117
+ bodyRowGap={20}
118
+ bodyColumnGap={10}
119
+ />
120
+ </Left>
121
+ <Right>
122
+ <Preview type={'Chat'} componentProps={props.componentProps} stylingProps={chatStyles} />
123
+ </Right>
124
+ </Container>
123
125
  );
124
126
  };
125
127
 
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const EventPreview = (props) => {
11
11
  const [eventStyles, setEventStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -58,10 +58,12 @@ const EventPreview = (props) => {
58
58
  ]
59
59
 
60
60
  const handleChange = (values) => {
61
- if(values){
62
- props.formChanged(values)
63
- setEventStyles(values)
64
- localStorage.setItem('formStyles', JSON.stringify(values))
61
+ if (props.formChanged) {
62
+ if (values) {
63
+ props.formChanged(values)
64
+ setEventStyles(values)
65
+ localStorage.setItem('formStyles', JSON.stringify(values))
66
+ }
65
67
  }
66
68
  }
67
69
 
@@ -8,118 +8,120 @@ import Picker from '../../Common Inputs/Picker/Picker';
8
8
  import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const EventsPreview = (props) => {
11
- const [eventsStyles, setEventsStyles] = useState({});
12
- const initialValues = {
13
- headerStyles: {
14
- headerBackground: '',
15
- padding: 0,
16
- titleColor: '',
17
- titleFontSize: '',
18
- titleFontWeight: '',
19
- controlsStyles: {
20
- iconSize: '',
21
- iconColor: ''
22
- }
23
- },
24
- customCardStyles: {
25
- cardBackgroundColor: '',
26
- onHoverBackgroundColor: '',
27
- cardRadius: '',
28
- cardTitleFontSize: '',
29
- cardTitleFontWeight: '',
30
- cardTitleColor: '',
31
- cardImageRadius: '',
32
- iconColor: '',
33
- cardPadding: 0,
34
- imgSize: 0,
35
- cardBorderSize: 0,
36
- cardBorderColor: '',
37
- dateColor: '',
38
- controlsStyles: ''
39
- }
11
+ const [eventsStyles, setEventsStyles] = useState({});
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
+ headerStyles: {
14
+ headerBackground: '',
15
+ padding: 0,
16
+ titleColor: '',
17
+ titleFontSize: '',
18
+ titleFontWeight: '',
19
+ controlsStyles: {
20
+ iconSize: '',
21
+ iconColor: ''
40
22
  }
23
+ },
24
+ customCardStyles: {
25
+ cardBackgroundColor: '',
26
+ onHoverBackgroundColor: '',
27
+ cardRadius: '',
28
+ cardTitleFontSize: '',
29
+ cardTitleFontWeight: '',
30
+ cardTitleColor: '',
31
+ cardImageRadius: '',
32
+ iconColor: '',
33
+ cardPadding: 0,
34
+ imgSize: 0,
35
+ cardBorderSize: 0,
36
+ cardBorderColor: '',
37
+ dateColor: '',
38
+ controlsStyles: ''
39
+ }
40
+ }
41
41
 
42
- const sections = [
43
- {
44
- title: "Header Styles",
45
- body: [
46
- (<Picker label="Header Background" name="headerStyles.headerBackground" />),
47
- (<TextField type="number" label="Padding" name="headerStyles.padding" />),
48
- (<Picker label="Title Color" name="headerStyles.titleColor" />),
49
- (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
50
- (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
51
- (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
52
- (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
53
- ]
54
- },
55
- {
56
- title: "Card Styles",
57
- body: [
58
- (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
59
- (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
60
- (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
61
- (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
62
- (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
63
- (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
64
- (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
65
- (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
66
- (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
67
- (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
68
- (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
69
- (<Picker label="Icons Color" name="customCardStyles.iconColor" />),
70
- (<Picker label="Date Color" name="customCardStyles.dateColor" />),
71
- (<Picker label="Card Icon Color" name="customCardStyles.controlsStyles.iconColor" />),
72
- ]
73
- },
42
+ const sections = [
43
+ {
44
+ title: "Header Styles",
45
+ body: [
46
+ (<Picker label="Header Background" name="headerStyles.headerBackground" />),
47
+ (<TextField type="number" label="Padding" name="headerStyles.padding" />),
48
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
49
+ (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
50
+ (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
51
+ (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
52
+ (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
74
53
  ]
54
+ },
55
+ {
56
+ title: "Card Styles",
57
+ body: [
58
+ (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
59
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
60
+ (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
61
+ (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
62
+ (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
63
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
64
+ (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
65
+ (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
66
+ (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
67
+ (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
68
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
69
+ (<Picker label="Icons Color" name="customCardStyles.iconColor" />),
70
+ (<Picker label="Date Color" name="customCardStyles.dateColor" />),
71
+ (<Picker label="Card Icon Color" name="customCardStyles.controlsStyles.iconColor" />),
72
+ ]
73
+ },
74
+ ]
75
75
 
76
- const handleChange = (values) => {
77
- if(values){
78
- props.formChanged(values)
79
- setEventsStyles(values)
80
- localStorage.setItem('formStyles', JSON.stringify(values))
81
- }
82
- }
83
-
84
- const submitHandler = (values) => {
85
- console.log(values);
86
- }
87
-
88
- const cancelHandler = () => {
89
- console.log('Canceled')
76
+ const handleChange = (values) => {
77
+ if (props.formChanged) {
78
+ if (values) {
79
+ props.formChanged(values)
80
+ setEventsStyles(values)
81
+ localStorage.setItem('formStyles', JSON.stringify(values))
90
82
  }
83
+ }
84
+ }
85
+
86
+ const submitHandler = (values) => {
87
+ console.log(values);
88
+ }
89
+
90
+ const cancelHandler = () => {
91
+ console.log('Canceled')
92
+ }
91
93
 
92
94
  return (
93
95
  <Container>
94
- <Left>
95
- <ReusableForm
96
- formTitle="Events Styles"
97
- initialValues={initialValues}
98
- sections={sections}
99
- headerStyles={{
100
- padding: 10,
101
- headerBackground: 'black',
102
- titleColor: '#ffff',
103
- }}
104
- sectionHeaderStyles={{
105
- padding: 6,
106
- headerBackground: '#FE1744',
107
- titleColor: '#ffff',
108
- }}
109
- bodyPadding={10}
110
- saveBtnText="Save"
111
- cancelBtnText="Cancel"
112
- saveBtnHandle={submitHandler}
113
- cancelHandler={cancelHandler}
114
- handleChange={handleChange}
115
- bodyRowGap={20}
116
- bodyColumnGap={10}
117
- />
118
- </Left>
119
- <Right>
120
- <Preview type={'Events'} componentProps={props.componentProps} stylingProps={eventsStyles} />
121
- </Right>
122
- </Container>
96
+ <Left>
97
+ <ReusableForm
98
+ formTitle="Events Styles"
99
+ initialValues={initialValues}
100
+ sections={sections}
101
+ headerStyles={{
102
+ padding: 10,
103
+ headerBackground: 'black',
104
+ titleColor: '#ffff',
105
+ }}
106
+ sectionHeaderStyles={{
107
+ padding: 6,
108
+ headerBackground: '#FE1744',
109
+ titleColor: '#ffff',
110
+ }}
111
+ bodyPadding={10}
112
+ saveBtnText="Save"
113
+ cancelBtnText="Cancel"
114
+ saveBtnHandle={submitHandler}
115
+ cancelHandler={cancelHandler}
116
+ handleChange={handleChange}
117
+ bodyRowGap={20}
118
+ bodyColumnGap={10}
119
+ />
120
+ </Left>
121
+ <Right>
122
+ <Preview type={'Events'} componentProps={props.componentProps} stylingProps={eventsStyles} />
123
+ </Right>
124
+ </Container>
123
125
  );
124
126
  };
125
127
 
@@ -10,7 +10,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
10
10
 
11
11
  const FoldersPreview = (props) => {
12
12
  const [foldersStyles, setFoldersStyles] = useState({});
13
- const initialValues = {
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
14
  headerStyles: {
15
15
  headerBackground: '',
16
16
  padding: 0,
@@ -69,11 +69,13 @@ const FoldersPreview = (props) => {
69
69
  ]
70
70
 
71
71
  const handleChange = (values) => {
72
- if(values){
73
- props.formChanged(values)
74
- setFoldersStyles(values)
75
- localStorage.setItem('formStyles', JSON.stringify(values))
76
- }
72
+ if (props.formChanged) {
73
+ if (values) {
74
+ props.formChanged(values)
75
+ setFoldersStyles(values)
76
+ localStorage.setItem('formStyles', JSON.stringify(values))
77
+ }
78
+ }
77
79
  }
78
80
 
79
81
  const submitHandler = (values) => {
@@ -66,10 +66,12 @@ const MusicAlbum = (props) => {
66
66
  ]
67
67
 
68
68
  const handleChange = (values) => {
69
- if(values){
70
- props.formChanged(values)
71
- setMusicAlbumStyles(values)
72
- localStorage.setItem('formStyles', JSON.stringify(values))
69
+ if (props.formChanged) {
70
+ if (values) {
71
+ props.formChanged(values)
72
+ setMusicAlbumStyles(values)
73
+ localStorage.setItem('formStyles', JSON.stringify(values))
74
+ }
73
75
  }
74
76
  }
75
77
 
@@ -12,7 +12,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
12
12
  const MusicAlbumsPreview = (props) => {
13
13
  const [musicAlbumsStyles, setMusicAlbumsStyles] = useState({})
14
14
 
15
- const initialValues = {
15
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
16
16
  headerStyles: {
17
17
  headerBackground: '',
18
18
  padding: 0,
@@ -43,7 +43,7 @@ const MusicAlbumsPreview = (props) => {
43
43
  body: [
44
44
  (<Picker label="Header Background" name="headerStyles.headerBackground" />),
45
45
  (<TextField type="number" label="Padding" name="headerStyles.padding" />),
46
- (<Picker label="Title Color" name="headerStyles.titleColor" />),
46
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
47
47
  (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
48
48
  (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />)
49
49
  ]
@@ -52,27 +52,29 @@ const MusicAlbumsPreview = (props) => {
52
52
  title: "Card Styles",
53
53
  body: [
54
54
  (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
55
- (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
55
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
56
56
  (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
57
57
  (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
58
58
  (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
59
- (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
59
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
60
60
  (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
61
61
  (<TextField type="number" label="Artist Font Size" name="customCardStyles.cardDescriptionFontSize" />),
62
- (<Picker label="Artist Font Color" name="customCardStyles.cardDescriptionColor" />),
62
+ (<Picker label="Artist Font Color" name="customCardStyles.cardDescriptionColor" />),
63
63
  (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
64
64
  (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
65
65
  (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
66
- (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
66
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
67
67
  ]
68
68
  },
69
69
  ]
70
70
 
71
71
  const handleChange = (values) => {
72
- if(values){
73
- props.formChanged(values)
74
- setMusicAlbumsStyles(values)
75
- localStorage.setItem('formStyles', JSON.stringify(values))
72
+ if (props.formChanged) {
73
+ if (values) {
74
+ props.formChanged(values)
75
+ setMusicAlbumsStyles(values)
76
+ localStorage.setItem('formStyles', JSON.stringify(values))
77
+ }
76
78
  }
77
79
  }
78
80
 
@@ -111,7 +113,7 @@ const MusicAlbumsPreview = (props) => {
111
113
  />
112
114
  </Left>
113
115
  <Right>
114
- <Preview type={'MusicAlbums'} componentProps={props.componentProps} stylingProps={musicAlbumsStyles} da />
116
+ <Preview type={'MusicAlbums'} componentProps={props.componentProps} stylingProps={musicAlbumsStyles} />
115
117
  </Right>
116
118
  </Container>
117
119
  );