@mohamed-karawia/library 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/stories/Chat/Chat.js +24 -31
  2. package/dist/stories/Community/Community.js +37 -15
  3. package/dist/stories/Events/Event/Event.js +12 -4
  4. package/dist/stories/Events/EventsList/EventsList.js +14 -7
  5. package/dist/stories/Library/Folders/Folders.js +27 -17
  6. package/dist/stories/Library/Notes/Notes.js +29 -18
  7. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +8 -44
  8. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +57 -37
  9. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +26 -16
  10. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +11 -4
  11. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +1 -1
  12. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +1 -1
  13. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +1 -1
  14. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +1 -1
  15. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +1 -1
  16. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +1 -1
  17. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +1 -1
  18. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +1 -1
  19. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +1 -1
  20. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +1 -1
  21. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +1 -1
  22. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +1 -1
  23. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +1 -1
  24. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +1 -1
  25. package/dist/stories/Reusable Components/Community/Community.js +12 -34
  26. package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +11 -4
  27. package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +17 -6
  28. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +24 -25
  29. package/dist/stories/store/communities.js +27 -29
  30. package/package.json +1 -1
  31. package/src/stories/Chat/Chat.jsx +25 -19
  32. package/src/stories/Community/Community.jsx +14 -15
  33. package/src/stories/Events/Event/Event.jsx +11 -3
  34. package/src/stories/Events/EventsList/EventsList.jsx +11 -4
  35. package/src/stories/Library/Folders/Folders.jsx +23 -14
  36. package/src/stories/Library/Notes/Notes.jsx +25 -15
  37. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +17 -61
  38. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +44 -30
  39. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +14 -5
  40. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +10 -3
  41. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +1 -1
  42. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +1 -1
  43. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +1 -1
  44. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +1 -1
  45. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +1 -1
  46. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +1 -1
  47. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +1 -1
  48. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +1 -1
  49. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +1 -1
  50. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +1 -1
  51. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +1 -1
  52. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +1 -1
  53. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +1 -1
  54. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +1 -1
  55. package/src/stories/Reusable Components/Community/Community.jsx +10 -33
  56. package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +10 -3
  57. package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +10 -3
  58. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +30 -34
  59. package/src/stories/store/communities.js +27 -29
@@ -29,14 +29,15 @@ const ViewAlbum = ({
29
29
  album,
30
30
  cardBackgroundColor,
31
31
  songTitleColor,
32
+ community,
32
33
  ...props }) => {
33
34
  const [showModal, setShowModal] = useState(false);
34
35
  const [showConfigModal, setShowConfigModal] = useState(false);
35
- const [centerContext, setCenterContext] = useState(<ViewAlbum album={album}/>)
36
+ const [centerContext, setCenterContext] = useState(<ViewAlbum preview={true} album={album} />)
36
37
 
37
38
  const formChanged = (values) => {
38
39
  console.log('context changed')
39
- setCenterContext(<ViewAlbum album={album} {...values} />)
40
+ setCenterContext(<ViewAlbum preview={true} album={album} {...values} />)
40
41
  }
41
42
 
42
43
 
@@ -48,6 +49,7 @@ const ViewAlbum = ({
48
49
  title: 'Context', id: 'community'
49
50
  }
50
51
  ]
52
+
51
53
  let sections = [
52
54
  {
53
55
  title: 'Styles',
@@ -126,65 +128,19 @@ const ViewAlbum = ({
126
128
  <div></div>
127
129
  )}
128
130
  >
129
- <Sections
130
- sections={sections}
131
- backgroundColor={'white'}
132
- sectionHeaderStyles={{
133
- titleColor: 'white',
134
- headerBackground: 'transparent'
135
- }}
136
- customCardStyles={{
137
- cardPadding: 6,
138
- cardTitleFontSize: 15,
139
- cardBackgroundColor: '#2c2c2c',
140
- cardTitleColor: 'white',
141
- onHoverBackgroundColor: '#555555',
142
- controlsStyles: {
143
- showOnHover: true,
144
- }
145
- }}>
146
- <Tabs
147
- title="Music Album Config"
148
- tabs={tabs}
149
- id='styling'
150
- >
151
- <MusicAlbumPreview
152
- componentProps={{ album, title: props.title || "My Album", preview: true }}
153
- formChanged={formChanged}
154
- id="preview"
155
- />
156
- <Community
157
- right={(
158
- <WidgetContainer
159
- widgetType='music player'
160
- widgetProps={{
161
- playlist: album,
162
- currentSong: 1,
163
- }}
164
- />
165
- )}
166
- left={
167
- (
168
- <WidgetContainer
169
- widgetType='spaces-list'
170
- widgetProps={{
171
- listTitle: 'Your Spaces',
172
- type: 'sectioned',
173
- spaces: SPACES,
174
- cardStyle: 'card-style-3',
175
- cardClicked: () => alert('clicked'),
176
- // headerStyles: styles.widgetContainer.header,
177
- // sectionHeaderStyles: styles.widgetContainer.body.sectionHeaderStyles,
178
- // customCardStyles: styles.widgetContainer.body.customCardStyles,
179
- }}
180
- />
181
- )
182
- }
183
- center={centerContext}
184
- id="community" />
185
- </Tabs>
186
-
187
- </Sections>
131
+ <Tabs
132
+ title="Album Config"
133
+ tabs={tabs}>
134
+ <MusicAlbumPreview
135
+ componentProps={{ album, title: props.title || "My Album", preview: true }}
136
+ formChanged={formChanged}
137
+ id="preview"
138
+ />
139
+ <Community
140
+ center={centerContext}
141
+ community={community}
142
+ id="community" />
143
+ </Tabs>
188
144
  </Modal>
189
145
  </Container>
190
146
  )
@@ -8,6 +8,8 @@ import CreateAlbum from '../../Forms/CreateMusicAlbum/CreateMusicAlbum';
8
8
  import Tabs from '../../Reusable Components/Tabs/Tabs';
9
9
  import Sections from '../../Sections/Sections';
10
10
  import MusicAlbumsPreview from '../../PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview';
11
+ import Community from '../../Reusable Components/Community/Community';
12
+
11
13
 
12
14
  import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
13
15
  import { BsGear } from "react-icons/bs";
@@ -23,19 +25,22 @@ const galleryControls = [
23
25
 
24
26
  const ViewAlbums = ({
25
27
  albums,
26
- albumTitleColor,
27
- descColor,
28
+ community,
28
29
  ...props
29
30
  }) => {
30
31
 
31
32
  const [showModal, setShowModal] = useState(false);
32
33
  const [showConfigModal, setShowConfigModal] = useState(false);
34
+ const [centerContext, setCenterContext] = useState(<ViewAlbums preview={true} albums={albums} />)
35
+
33
36
 
34
- const tabs = [
37
+
38
+ let tabs = [
39
+ {
40
+ title: 'New', id: 'preview'
41
+ },
35
42
  {
36
- title: 'New', component: (<MusicAlbumsPreview
37
- componentProps={{ albums, title: props.title || 'Music Albums' }}
38
- />)
43
+ title: 'Context', id: 'community'
39
44
  }
40
45
  ]
41
46
 
@@ -54,15 +59,17 @@ const ViewAlbums = ({
54
59
  ]
55
60
 
56
61
  const onHeaderIconClicked = (action) => {
57
- switch (action) {
58
- case 'add':
59
- setShowModal(true)
60
- break;
61
- case 'config':
62
- setShowConfigModal(true)
63
- break;
64
- default:
65
- break;
62
+ if (!props.preview) {
63
+ switch (action) {
64
+ case 'add':
65
+ setShowModal(true)
66
+ break;
67
+ case 'config':
68
+ setShowConfigModal(true)
69
+ break;
70
+ default:
71
+ break;
72
+ }
66
73
  }
67
74
  }
68
75
 
@@ -70,6 +77,9 @@ const ViewAlbums = ({
70
77
  props.cardIconClicked(action, index)
71
78
  }
72
79
 
80
+ const formChanged = (values) => {
81
+ setCenterContext(<ViewAlbums preview={true} albums={albums} {...values} />)
82
+ }
73
83
 
74
84
  const onAddAlbum = (album) => {
75
85
  setShowModal(false)
@@ -80,6 +90,11 @@ const ViewAlbums = ({
80
90
  setShowModal(false)
81
91
  }
82
92
 
93
+ const cancelConfig = () => {
94
+ setShowConfigModal(false);
95
+ localStorage.removeItem('formStyles')
96
+ }
97
+
83
98
  return (
84
99
  <Container>
85
100
  <Gallery
@@ -107,25 +122,24 @@ const ViewAlbums = ({
107
122
  </Modal>
108
123
  <Modal
109
124
  modalIsOpen={showConfigModal}
110
- closeModal={() => setShowConfigModal(false)}
125
+ closeModal={cancelConfig}
111
126
  exitModalButton={(e) => (
112
127
  <div></div>
113
128
  )}
114
129
  >
115
- <Sections
116
- sections={sections}
117
- backgroundColor={'white'}
118
- sectionHeaderStyles={{
119
- titleColor: 'white',
120
- headerBackground: 'transparent'
121
- }}
122
- customCardStyles={{
123
- cardPadding: 6,
124
- cardTitleFontSize: 15,
125
- cardBackgroundColor: '#2c2c2c',
126
- cardTitleColor: 'white',
127
- onHoverBackgroundColor: '#555555',
128
- }} />
130
+ <Tabs
131
+ title="Albums Config"
132
+ tabs={tabs}>
133
+ <MusicAlbumsPreview
134
+ componentProps={{ albums: albums, title: 'Music Albums', preview: true }}
135
+ formChanged={formChanged}
136
+ id='preview'
137
+ />
138
+ <Community
139
+ center={centerContext}
140
+ community={community}
141
+ id="community" />
142
+ </Tabs>
129
143
  </Modal>
130
144
  </Container>
131
145
  )
@@ -30,6 +30,7 @@ const ViewAlbum = ({
30
30
  cardBackgroundColor,
31
31
  imgTitleColor,
32
32
  descColor,
33
+ community,
33
34
  ...props
34
35
  }) => {
35
36
 
@@ -61,10 +62,10 @@ const ViewAlbum = ({
61
62
  const [openedImgIndex, setOpenedImgIndex] = useState(null);
62
63
  const [openedImg, setOpenedImg] = useState(null);
63
64
 
64
- const [centerContext, setCenterContext] = useState(<ViewAlbum album={album} />)
65
+ const [centerContext, setCenterContext] = useState(<ViewAlbum preview={true} album={album} />)
65
66
 
66
67
  const formChanged = (values) => {
67
- setCenterContext(<ViewAlbum album={album} {...values} />)
68
+ setCenterContext(<ViewAlbum preview={true} album={album} {...values} />)
68
69
  }
69
70
 
70
71
  let tabs = [
@@ -92,7 +93,8 @@ const ViewAlbum = ({
92
93
  }, [openedImgIndex, handleUserKeyPress]);
93
94
 
94
95
  const onIconClicked = (action) => {
95
- switch (action) {
96
+ if(!props.preview){
97
+ switch (action) {
96
98
  case 'add':
97
99
  setShowModal(true)
98
100
  break;
@@ -101,7 +103,7 @@ const ViewAlbum = ({
101
103
  break;
102
104
  default:
103
105
  break;
104
- }
106
+ }}
105
107
  }
106
108
 
107
109
  const cardIconClicked = (action, index) => {
@@ -136,6 +138,11 @@ const ViewAlbum = ({
136
138
  }
137
139
  }
138
140
 
141
+ const cancelConfig = () => {
142
+ setShowConfigModal(false);
143
+ localStorage.removeItem('formStyles')
144
+ }
145
+
139
146
  return (
140
147
  <Container>
141
148
  <Gallery
@@ -187,7 +194,7 @@ const ViewAlbum = ({
187
194
  </Modal>
188
195
  <Modal
189
196
  modalIsOpen={showConfigModal}
190
- closeModal={() => setShowConfigModal(false)}
197
+ closeModal={cancelConfig}
191
198
  exitModalButton={(e) => (
192
199
  <div></div>
193
200
  )}
@@ -200,9 +207,11 @@ const ViewAlbum = ({
200
207
  <PhotoAlbumPreview
201
208
  componentProps={{ album, title: props.title || 'Photo Album', preview: true }}
202
209
  formChanged={formChanged}
210
+ id='preview'
203
211
  />
204
212
  <Community
205
213
  center={centerContext}
214
+ community={community}
206
215
  id="community" />
207
216
  </Tabs>
208
217
  </Modal>
@@ -24,14 +24,15 @@ const galleryControls = [
24
24
 
25
25
  const ViewAlbums = ({
26
26
  albums,
27
+ community,
27
28
  ...props }) => {
28
29
 
29
30
  const [showModal, setShowModal] = useState(false);
30
31
  const [showConfigModal, setShowConfigModal] = useState(false);
31
- const [centerContext, setCenterContext] = useState(<ViewAlbums albums={albums} />)
32
+ const [centerContext, setCenterContext] = useState(<ViewAlbums preview={true} albums={albums} />)
32
33
 
33
34
  const formChanged = (values) => {
34
- setCenterContext(<ViewAlbums albums={albums} {...values} />)
35
+ setCenterContext(<ViewAlbums preview={true} albums={albums} {...values} />)
35
36
  }
36
37
 
37
38
 
@@ -75,6 +76,11 @@ const ViewAlbums = ({
75
76
  setShowModal(false)
76
77
  }
77
78
 
79
+ const cancelConfig = () => {
80
+ setShowConfigModal(false);
81
+ localStorage.removeItem('formStyles')
82
+ }
83
+
78
84
  return (
79
85
  <Container>
80
86
  <Gallery
@@ -100,7 +106,7 @@ const ViewAlbums = ({
100
106
  </Modal>
101
107
  <Modal
102
108
  modalIsOpen={showConfigModal}
103
- closeModal={() => setShowConfigModal(false)}
109
+ closeModal={cancelConfig}
104
110
  exitModalButton={(e) => (
105
111
  <div></div>
106
112
  )}
@@ -117,6 +123,7 @@ const ViewAlbums = ({
117
123
  />
118
124
  <Community
119
125
  center={centerContext}
126
+ community={community}
120
127
  id="community" />
121
128
  </Tabs>
122
129
  </Modal>
@@ -10,7 +10,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
10
10
 
11
11
  const ChatPreview = (props) => {
12
12
  const [chatStyles, setChatStyles] = useState({});
13
- const initialValues = {
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
14
  headerStyles: {
15
15
  headerBackground: '',
16
16
  padding: 0,
@@ -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,
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const EventsPreview = (props) => {
11
11
  const [eventsStyles, setEventsStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -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,
@@ -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,
@@ -11,7 +11,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
11
11
 
12
12
  const MusicPlayerPreview = (props) => {
13
13
  const [musicPlayerStyles, setMusicPlayerStyles] = useState({});
14
- const initialValues = {
14
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
15
15
  headerStyles: {
16
16
  headerBackground: '',
17
17
  padding: 0,
@@ -10,7 +10,7 @@ import Picker from '../../Common Inputs/Picker/Picker';
10
10
  const NavbarPreview = (props) => {
11
11
  const [navbarStyles, setNavbarStyles] = useState({})
12
12
 
13
- const initialValues = {
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
14
  iconSize: 'md',
15
15
  iconBackgroundColor: 'black',
16
16
  navbarColor: 'white',
@@ -10,7 +10,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
10
10
 
11
11
  const NotesPreview = (props) => {
12
12
  const [notesStyles, setNotesStyles] = useState({});
13
- const initialValues = {
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
14
  headerStyles: {
15
15
  headerBackground: '',
16
16
  padding: 0,
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const PhotoAlbumPreview = (props) => {
11
11
  const [photoAlbumStyles, setPhotoAlbumStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const PhotoAlbumsPreview = (props) => {
11
11
  const [photoAlbumsStyles, setPhotoAlbumsStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const SpacesListPreview = (props) => {
11
11
  const [spacesStyles, setSpacesStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const VideoAlbumPreview = (props) => {
11
11
  const [videoAlbumStyles, setVideoAlbumStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -10,7 +10,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
10
10
 
11
11
  const VideoAlbumsPreview = (props) => {
12
12
  const [videoAlbumsStyles, setVideoAlbumsStyles] = useState({});
13
- const initialValues = {
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
14
  headerStyles: {
15
15
  headerBackground: '',
16
16
  padding: 0,
@@ -9,7 +9,7 @@ import TextField from '../../Common Inputs/TextField/TextField';
9
9
 
10
10
  const VideoPreview = (props) => {
11
11
  const [videoStyles, setVideoStyles] = useState({});
12
- const initialValues = {
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
13
13
  headerStyles: {
14
14
  headerBackground: '',
15
15
  padding: 0,
@@ -9,62 +9,39 @@ import Left from '../../Layout/Left/Left'
9
9
  import Center from '../../Layout/Center/Center'
10
10
  import Right from '../../Layout/Right/Right'
11
11
  import WidgetContainer from "../../Reusable Components/WidgetContainer/WidgetContainer";
12
+ import BaseMaterial from '../../Containers/BaseMaterial'
12
13
  // import styles from '../../styling.json'
13
14
 
14
15
 
15
16
 
16
17
  const Community = ({
17
18
  context,
19
+ community,
18
20
  ...props
19
21
  }) => {
20
22
 
21
- const spaces = [
22
- {
23
- title: 'Main List',
24
- data: [
25
- { title: 'Cargo Sprint', path: 'cago' },
26
- { title: 'Movies', path: 'movies' }
27
- ],
28
- },
29
- {
30
- title: 'Entertainment',
31
- data: [
32
- { title: 'Gaming', path: 'games' },
33
- { title: 'Music', path: 'music' }
34
- ]
35
- }
36
- ]
23
+ const spacesWidget = community.spacesListWidget.widgetSpacesList
37
24
 
38
25
  return (
39
- <Container>
40
- <Navbar />
26
+ <BaseMaterial {...community.styles}>
27
+ <Navbar {...community.navbarStyles} />
41
28
  <Body>
42
29
  <Left>
43
30
  <WidgetContainer
44
31
  widgetType='spaces-list'
45
32
  widgetProps={{
46
- listTitle: 'Your Spaces',
47
- spaces: spaces,
48
- cardClicked: () => alert('clicked'),
49
- // headerStyles: styles.widgetContainer.header,
50
- // sectionHeaderStyles: styles.widgetContainer.body.sectionHeaderStyles,
51
- // customCardStyles: styles.widgetContainer.body.customCardStyles,
33
+ listTitle: spacesWidget.listTitle,
34
+ spaces: spacesWidget.spaces,
35
+ cardClicked: () => null,
36
+ ...spacesWidget.styles
52
37
  }}
53
38
  />
54
39
  </Left>
55
40
  <Center>{props.center}</Center>
56
41
  <Right>{props.right}</Right>
57
42
  </Body>
58
- </Container>
43
+ </BaseMaterial>
59
44
  );
60
45
  };
61
46
 
62
- const Container = styled.div`
63
- width: 100%;
64
- height: auto;
65
- display: flex;
66
- min-height: 100vh;
67
- flex-direction: column;
68
- `
69
-
70
47
  export default Community;
@@ -30,13 +30,14 @@ const AlbumsGallery = ({
30
30
  cardTitleFontSize,
31
31
  countColor,
32
32
  countFontSize,
33
+ community,
33
34
  ...props }) => {
34
35
  const [showModal, setShowModal] = useState(false);
35
36
  const [showConfigModal, setShowConfigModal] = useState(false);
36
- const [centerContext, setCenterContext] = useState(<AlbumsGallery videoAlbums={videoAlbums} />)
37
+ const [centerContext, setCenterContext] = useState(<AlbumsGallery preview={true} videoAlbums={videoAlbums} />)
37
38
 
38
39
  const formChanged = (values) => {
39
- setCenterContext(<AlbumsGallery videoAlbums={videoAlbums} {...values} />)
40
+ setCenterContext(<AlbumsGallery preview={true} videoAlbums={videoAlbums} {...values} />)
40
41
  }
41
42
 
42
43
  let tabs = [
@@ -101,6 +102,11 @@ const AlbumsGallery = ({
101
102
  setShowModal(false)
102
103
  }
103
104
 
105
+ const cancelConfig = () => {
106
+ setShowConfigModal(false);
107
+ localStorage.removeItem('formStyles')
108
+ }
109
+
104
110
  return (
105
111
  <Container>
106
112
  <Gallery
@@ -131,7 +137,7 @@ const AlbumsGallery = ({
131
137
  </Modal>
132
138
  <Modal
133
139
  modalIsOpen={showConfigModal}
134
- closeModal={() => setShowConfigModal(false)}
140
+ closeModal={cancelConfig}
135
141
  exitModalButton={(e) => (
136
142
  <div></div>
137
143
  )}>
@@ -146,6 +152,7 @@ const AlbumsGallery = ({
146
152
  id="preview" />
147
153
  <Community
148
154
  center={centerContext}
155
+ community={community}
149
156
  id="community" />
150
157
  </Tabs>
151
158
  </Modal>
@@ -38,12 +38,13 @@ const VideoSpace = ({
38
38
  commentBackgroundColor,
39
39
  commentTitleColor,
40
40
  commentTitleFontSize,
41
+ community,
41
42
  ...props }) => {
42
43
  const [showConfigModal, setShowConfigModal] = useState(false);
43
- const [centerContext, setCenterContext] = useState(<VideoSpace videoSrc={videoSrc} />)
44
+ const [centerContext, setCenterContext] = useState(<VideoSpace users={users} preview={true} videoSrc={videoSrc} comments={comments} />)
44
45
 
45
46
  const formChanged = (values) => {
46
- setCenterContext(<VideoSpace videoSrc={videoSrc} {...values} />)
47
+ setCenterContext(<VideoSpace users={users} preview={true} videoSrc={videoSrc} comments={comments} {...values} />)
47
48
  }
48
49
 
49
50
  let tabs = [
@@ -68,6 +69,11 @@ const VideoSpace = ({
68
69
  }
69
70
  }
70
71
 
72
+ const cancelConfig = () => {
73
+ setShowConfigModal(false);
74
+ localStorage.removeItem('formStyles')
75
+ }
76
+
71
77
  return (
72
78
  <Container backgroundColor={backgroundColor}>
73
79
  <ReusableHeader
@@ -96,7 +102,7 @@ const VideoSpace = ({
96
102
  />
97
103
  <Modal
98
104
  modalIsOpen={showConfigModal}
99
- closeModal={() => setShowConfigModal(false)}
105
+ closeModal={cancelConfig}
100
106
  exitModalButton={(e) => (
101
107
  <div></div>
102
108
  )}
@@ -113,6 +119,7 @@ const VideoSpace = ({
113
119
 
114
120
  <Community
115
121
  center={centerContext}
122
+ community={community}
116
123
  id="community" />
117
124
  </Tabs>
118
125
  </Modal>