@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
@@ -0,0 +1,108 @@
1
+ import React, { useState } from "react";
2
+ import PropTypes from "prop-types";
3
+ import styled from "styled-components";
4
+
5
+ import Gallery from "../../Reusable Components/Gallery/Gallery";
6
+ import CreateMusicAlbumModal from '../../Modals/CreateMusicAlbumModal/CreateMusicAlbumModal';
7
+ import MusicAlbumsConfigModal from "../../Modals/MusicAlbumsConfigModal/MusicAlbumsConfigModal";
8
+
9
+
10
+ import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
11
+ import { BsGear } from "react-icons/bs";
12
+
13
+ const cardControls = [
14
+ { icon: <AiFillDelete />, action: "delete", name: "Delete album" },
15
+ ];
16
+
17
+ const galleryControls = [
18
+ { icon: <AiOutlineFileAdd />, action: "add", name: "Add Album" },
19
+ { icon: <BsGear />, action: "config", name: "Config" },
20
+ ];
21
+
22
+ const ViewAlbums = ({ albums, community, ...props }) => {
23
+ const [showModal, setShowModal] = useState(false);
24
+ const [showConfigModal, setShowConfigModal] = useState(false);
25
+
26
+ const onHeaderIconClicked = (action) => {
27
+ if (!props.preview) {
28
+ switch (action) {
29
+ case "add":
30
+ setShowModal(true);
31
+ break;
32
+ case "config":
33
+ setShowConfigModal(true);
34
+ break;
35
+ default:
36
+ break;
37
+ }
38
+ }
39
+ };
40
+
41
+ const cardIconClicked = (action, index) => {
42
+ props.cardIconClicked(action, index);
43
+ };
44
+
45
+
46
+ const onAddAlbum = (album) => {
47
+ setShowModal(false);
48
+ props.onAddAlbum(album);
49
+ };
50
+
51
+ const closeModal = () => {
52
+ setShowModal(false);
53
+ };
54
+
55
+ const cancelConfig = () => {
56
+ setShowConfigModal(false);
57
+ localStorage.removeItem("formStyles");
58
+ };
59
+
60
+ return (
61
+ <Container>
62
+ <Gallery
63
+ galleryTitle={props.title || "Music Albums"}
64
+ data={albums}
65
+ type="flat"
66
+ cardStyle="card-style-6"
67
+ galleryControls={galleryControls}
68
+ iconClicked={onHeaderIconClicked}
69
+ cardControls={cardControls}
70
+ cardIconClicked={cardIconClicked}
71
+ {...props}
72
+ />
73
+ <CreateMusicAlbumModal
74
+ showModal={showModal}
75
+ onAddAlbum={onAddAlbum}
76
+ closeModal={closeModal}
77
+ saveBtnText={props.saveBtnText}
78
+ cancelBtnText={props.cancelBtnText}
79
+ />
80
+ <MusicAlbumsConfigModal
81
+ showConfigModal={showConfigModal}
82
+ cancelConfig={cancelConfig}
83
+ albums={albums}
84
+ community={community}
85
+ />
86
+ </Container>
87
+ );
88
+ };
89
+ const Container = styled.div`
90
+ width: 100%;
91
+ `;
92
+
93
+ ViewAlbums.defaultProps = {};
94
+
95
+ ViewAlbums.propTypes = {
96
+ albums: PropTypes.array,
97
+ cardIconClicked: PropTypes.func,
98
+ onAddAlbum: PropTypes.func,
99
+ cardBackgroundColor: PropTypes.string,
100
+ albumTitleColor: PropTypes.string,
101
+ descColor: PropTypes.string,
102
+ title: PropTypes.string,
103
+ saveBtnText: PropTypes.string,
104
+ cancelBtnText: PropTypes.string,
105
+ preview: PropTypes.bool,
106
+ };
107
+
108
+ export default ViewAlbums;
@@ -4,15 +4,10 @@ import PropTypes from 'prop-types';
4
4
 
5
5
  import AddPhoto from '../../Forms/AddPhoto/AddPhoto'
6
6
  import Gallery from '../../Reusable Components/Gallery/Gallery';
7
- import Modal from '../../Reusable Components/ReactModal/ReactModal';
8
- import DetailedPhoto from '../DetailedPhoto/DetailedPhoto';
9
- import PhotoAlbumPreview from '../../PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview';
10
- import Tabs from '../../Reusable Components/Tabs/Tabs';
11
- import Sections from '../../Sections/Sections';
12
- import Community from '../../Reusable Components/Community/Community';
13
-
14
-
15
- import { AiOutlineArrowLeft, AiOutlineArrowRight, AiOutlineClose, AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
7
+ import AddPhotoModal from '../../Modals/AddPhotoModal/AddPhotoModal';
8
+ import ShowImgModal from '../../Modals/ShowImgModal/ShowImgModal';
9
+ import PhotoAlbumConfigModal from '../../Modals/PhotoAlbumConfigModal/PhotoAlbumConfigModal';
10
+ import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
16
11
  import { BsGear } from "react-icons/bs";
17
12
 
18
13
 
@@ -30,6 +25,7 @@ const ViewAlbum = ({
30
25
  cardBackgroundColor,
31
26
  imgTitleColor,
32
27
  descColor,
28
+ community,
33
29
  ...props
34
30
  }) => {
35
31
 
@@ -61,20 +57,7 @@ const ViewAlbum = ({
61
57
  const [openedImgIndex, setOpenedImgIndex] = useState(null);
62
58
  const [openedImg, setOpenedImg] = useState(null);
63
59
 
64
- const [centerContext, setCenterContext] = useState(<ViewAlbum album={album} />)
65
-
66
- const formChanged = (values) => {
67
- setCenterContext(<ViewAlbum album={album} {...values} />)
68
- }
69
60
 
70
- let tabs = [
71
- {
72
- title: 'New', id: 'preview'
73
- },
74
- {
75
- title: 'Context', id: 'community'
76
- }
77
- ]
78
61
 
79
62
 
80
63
  const handleUserKeyPress = useCallback(event => {
@@ -92,15 +75,17 @@ const ViewAlbum = ({
92
75
  }, [openedImgIndex, handleUserKeyPress]);
93
76
 
94
77
  const onIconClicked = (action) => {
95
- switch (action) {
96
- case 'add':
97
- setShowModal(true)
98
- break;
99
- case 'config':
100
- setShowConfigModal(true)
101
- break;
102
- default:
103
- break;
78
+ if (!props.preview) {
79
+ switch (action) {
80
+ case 'add':
81
+ setShowModal(true)
82
+ break;
83
+ case 'config':
84
+ setShowConfigModal(true)
85
+ break;
86
+ default:
87
+ break;
88
+ }
104
89
  }
105
90
  }
106
91
 
@@ -115,7 +100,7 @@ const ViewAlbum = ({
115
100
  props.addPhoto(photo)
116
101
  }
117
102
 
118
- const cancelHandler = () => {
103
+ const closeModal = () => {
119
104
  setShowModal(false)
120
105
  }
121
106
 
@@ -136,6 +121,16 @@ const ViewAlbum = ({
136
121
  }
137
122
  }
138
123
 
124
+ const closeImgModal = () => {
125
+ setShowImgModal(false)
126
+ setOpenedImgIndex(null)
127
+ }
128
+
129
+ const cancelConfig = () => {
130
+ setShowConfigModal(false);
131
+ localStorage.removeItem('formStyles')
132
+ }
133
+
139
134
  return (
140
135
  <Container>
141
136
  <Gallery
@@ -151,61 +146,27 @@ const ViewAlbum = ({
151
146
  customCardStyles={cardStyles}
152
147
  {...props} />
153
148
 
154
- <Modal
155
- modalIsOpen={showModal}
156
- closeModal={() => setShowModal(false)}
157
- exitModalButton={(e) => (
158
- <div></div>
159
- )}>
160
- <AddPhoto
161
- saveHandler={onAddPhoto}
162
- cancelHandler={cancelHandler}
163
- saveBtnText={props.saveBtnText || 'Add'}
164
- cancelBtnText={props.saveBtnText || 'Cancel'} />
165
- </Modal>
166
- <Modal
167
- modalIsOpen={showImgModal}
168
- closeModal={() => {
169
- setShowImgModal(false)
170
- setOpenedImgIndex(null)
171
- }}
172
- exitModalButton={(e) => (
173
- <div></div>
174
- )}
175
- width="70vw"
176
- height="90vh">
177
- <CloseIconContainer onClick={() => setShowImgModal(false)}>
178
- <AiOutlineClose />
179
- </CloseIconContainer>
180
- <LeftIconContainer onClick={prevPhoto}>
181
- <AiOutlineArrowLeft />
182
- </LeftIconContainer>
183
- <DetailedPhoto cardClicked={nextPhoto} img={openedImg} />
184
- <RightIconContainer onClick={nextPhoto}>
185
- <AiOutlineArrowRight />
186
- </RightIconContainer>
187
- </Modal>
188
- <Modal
189
- modalIsOpen={showConfigModal}
190
- closeModal={() => setShowConfigModal(false)}
191
- exitModalButton={(e) => (
192
- <div></div>
193
- )}
194
- >
195
- <Tabs
196
- title="Photo Album Config"
197
- tabs={tabs}
198
- id='styling'
199
- >
200
- <PhotoAlbumPreview
201
- componentProps={{ album, title: props.title || 'Photo Album', preview: true }}
202
- formChanged={formChanged}
203
- />
204
- <Community
205
- center={centerContext}
206
- id="community" />
207
- </Tabs>
208
- </Modal>
149
+ <AddPhotoModal
150
+ showModal={showModal}
151
+ onAddPhoto={onAddPhoto}
152
+ closeModal={closeModal}
153
+ saveBtnText={props.saveBtnText}
154
+ cancelBtnText={props.cancelBtnText}
155
+ />
156
+ <ShowImgModal
157
+ showImgModal={showImgModal}
158
+ closeModal={closeImgModal}
159
+ prevPhoto={prevPhoto}
160
+ nextPhoto={nextPhoto}
161
+ openedImg={openedImg}
162
+ />
163
+ <PhotoAlbumConfigModal
164
+ showConfigModal={showConfigModal}
165
+ cancelConfig={cancelConfig}
166
+ album={album}
167
+ community={community}
168
+ title={props.title}
169
+ />
209
170
  </Container>
210
171
  )
211
172
  }
@@ -214,53 +175,6 @@ const Container = styled.div`
214
175
 
215
176
  `
216
177
 
217
- const IconContainer = styled.div`
218
- width: 30px;
219
- height: 30px;
220
- background-color: #757575;
221
- position: absolute;
222
- transform: translateY(-50%);
223
- top: 50%;
224
- display: flex;
225
- justify-content: center;
226
- align-items: center;
227
- border-radius: 50rem;
228
- z-index: 999;
229
- cursor: pointer;
230
- opacity: .4;
231
- transition: all .2s;
232
-
233
- &:hover{
234
- opacity: 1;
235
- transform: scale(1.1) translateY(-50%);
236
- }
237
-
238
- svg{
239
- color: white;
240
- }
241
-
242
- `
243
-
244
- const CloseIconContainer = styled.div`
245
- position: absolute;
246
- z-index: 999;
247
- right: 10px;
248
- top: 10px;
249
- cursor: pointer;
250
-
251
- svg{
252
- color: white;
253
- }
254
- `
255
-
256
- const LeftIconContainer = styled(IconContainer)`
257
- left: 10px;
258
- `
259
-
260
- const RightIconContainer = styled(IconContainer)`
261
- right: 10px;
262
- `
263
-
264
178
  ViewAlbum.defaultProps = {
265
179
  headerBackground: '#FE1744',
266
180
  titleColor: 'white',
@@ -2,13 +2,9 @@ import React, { useState } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
- import CreateAlbum from '../../Forms/CreateAlbum/CreateAlbum'
6
5
  import Gallery from '../../Reusable Components/Gallery/Gallery';
7
- import Modal from '../../Reusable Components/ReactModal/ReactModal';
8
- import PhotoAlbumsPreview from '../../PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview';
9
- import Tabs from '../../Reusable Components/Tabs/Tabs';
10
- import Sections from '../../Sections/Sections';
11
- import Community from '../../Reusable Components/Community/Community';
6
+ import AddPhotoAlbum from '../../Modals/AddPhotoAlbum/AddPhotoAlbum';
7
+ import PhotoAlbumsConfigModal from '../../Modals/PhotoAlbumsConfigModal/PhotoAlbumsConfigModal';
12
8
 
13
9
  import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
14
10
  import { BsGear } from "react-icons/bs";
@@ -24,25 +20,12 @@ const galleryControls = [
24
20
 
25
21
  const ViewAlbums = ({
26
22
  albums,
23
+ community,
27
24
  ...props }) => {
28
25
 
29
26
  const [showModal, setShowModal] = useState(false);
30
27
  const [showConfigModal, setShowConfigModal] = useState(false);
31
- const [centerContext, setCenterContext] = useState(<ViewAlbums albums={albums} />)
32
-
33
- const formChanged = (values) => {
34
- setCenterContext(<ViewAlbums albums={albums} {...values} />)
35
- }
36
-
37
-
38
- let tabs = [
39
- {
40
- title: 'New', id: 'preview'
41
- },
42
- {
43
- title: 'Context', id: 'community'
44
- }
45
- ]
28
+
46
29
 
47
30
 
48
31
  const onIconClicked = (action) => {
@@ -71,10 +54,15 @@ const ViewAlbums = ({
71
54
  setShowModal(false)
72
55
  }
73
56
 
74
- const cancelHandler = () => {
57
+ const closeModal = () => {
75
58
  setShowModal(false)
76
59
  }
77
60
 
61
+ const cancelConfig = () => {
62
+ setShowConfigModal(false);
63
+ localStorage.removeItem('formStyles')
64
+ }
65
+
78
66
  return (
79
67
  <Container>
80
68
  <Gallery
@@ -88,38 +76,18 @@ const ViewAlbums = ({
88
76
  cardIconClicked={cardIconClicked}
89
77
  {...props} />
90
78
 
91
- <Modal
92
- modalIsOpen={showModal}
93
- closeModal={() => setShowModal(false)}
94
- exitModalButton={(e) => (
95
- <div></div>
96
- )}>
97
- <CreateAlbum
98
- saveHandler={onAddAlbum}
99
- cancelHandler={cancelHandler} />
100
- </Modal>
101
- <Modal
102
- modalIsOpen={showConfigModal}
103
- closeModal={() => setShowConfigModal(false)}
104
- exitModalButton={(e) => (
105
- <div></div>
106
- )}
107
- >
108
- <Tabs
109
- title="Photo Albums Config"
110
- tabs={tabs}
111
- id='styling'
112
- >
113
- <PhotoAlbumsPreview
114
- componentProps={{ albums, title: props.title || 'Photo Albums', preview: true }}
115
- formChanged={formChanged}
116
- id='preview'
117
- />
118
- <Community
119
- center={centerContext}
120
- id="community" />
121
- </Tabs>
122
- </Modal>
79
+ <AddPhotoAlbum
80
+ showModal={showModal}
81
+ onAddAlbum={onAddAlbum}
82
+ closeModal={closeModal}
83
+ />
84
+ <PhotoAlbumsConfigModal
85
+ showConfigModal={showConfigModal}
86
+ cancelConfig={cancelConfig}
87
+ albums={albums}
88
+ community={community}
89
+ title={props.title}
90
+ />
123
91
  </Container>
124
92
  )
125
93
  }
@@ -2,18 +2,12 @@ import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import Modal from '../../Reusable Components/ReactModal/ReactModal'
6
- import VideoPlayer from '../VideoPlayer/VideoPlayer';
7
- import Comments from '../Comments/Comments';
5
+ import VideoPlayer from '../../Widgets/VideoPlayer/VideoPlayer';
6
+ import VideoConfigModal from '../../Modals/VideoConfigModal/VideoConfigModal';
7
+ import Comments from '../../Reusable Components/Comments/Comments';
8
8
  import RichTextInput from '../../Common Inputs/RichTextInput/RichTextInput';
9
9
  import ReusableHeader from '../../Reusable Components/ReusableHeader/ReusableHeader';
10
10
  import { BsGear } from "react-icons/bs";
11
- import VideoPreview from '../../PreviewComponents/VideoPreview/VideoPreview';
12
- import Community from '../../Reusable Components/Community/Community';
13
- import Tabs from '../../Reusable Components/Tabs/Tabs';
14
-
15
-
16
-
17
11
 
18
12
  const controls = [
19
13
  { icon: (<BsGear />), action: 'config', name: 'Config' },
@@ -38,24 +32,10 @@ const VideoSpace = ({
38
32
  commentBackgroundColor,
39
33
  commentTitleColor,
40
34
  commentTitleFontSize,
35
+ community,
41
36
  ...props }) => {
42
37
  const [showConfigModal, setShowConfigModal] = useState(false);
43
- const [centerContext, setCenterContext] = useState(<VideoSpace videoSrc={videoSrc} />)
44
-
45
- const formChanged = (values) => {
46
- setCenterContext(<VideoSpace videoSrc={videoSrc} {...values} />)
47
- }
48
-
49
- let tabs = [
50
- {
51
- title: 'New', id: 'preview'
52
- },
53
- {
54
- title: 'Context', id: 'community'
55
- }
56
- ]
57
-
58
-
38
+
59
39
  const iconClicked = (action) => {
60
40
  if (!props.preview) {
61
41
  switch (action) {
@@ -68,6 +48,11 @@ const VideoSpace = ({
68
48
  }
69
49
  }
70
50
 
51
+ const cancelConfig = () => {
52
+ setShowConfigModal(false);
53
+ localStorage.removeItem('formStyles')
54
+ }
55
+
71
56
  return (
72
57
  <Container backgroundColor={backgroundColor}>
73
58
  <ReusableHeader
@@ -94,28 +79,17 @@ const VideoSpace = ({
94
79
  <RichTextInput
95
80
  users={users}
96
81
  />
97
- <Modal
98
- modalIsOpen={showConfigModal}
99
- closeModal={() => setShowConfigModal(false)}
100
- exitModalButton={(e) => (
101
- <div></div>
102
- )}
103
- >
104
- <Tabs
105
- title="Video Space Config"
106
- tabs={tabs}
107
- id='styling'
108
- >
109
- <VideoPreview
110
- componentProps={{ title, discription, comments, date, preview: true }}
111
- formChanged={formChanged}
112
- id="preview" />
113
-
114
- <Community
115
- center={centerContext}
116
- id="community" />
117
- </Tabs>
118
- </Modal>
82
+ <VideoConfigModal
83
+ showConfigModal={showConfigModal}
84
+ cancelConfig={cancelConfig}
85
+ community={community}
86
+ videoSrc={videoSrc}
87
+ title={title}
88
+ discription={discription}
89
+ date={date}
90
+ users={users}
91
+ comments={comments}
92
+ />
119
93
  </Container>
120
94
  )
121
95
  }