@mohamed-karawia/library 0.1.20 → 0.1.23

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 +27 -27
  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 +13 -6
  5. package/dist/stories/Events/EventsList/EventsList.js +14 -11
  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 -21
  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 +9 -46
  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 +13 -36
  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,77 @@
1
+ import React, { useState } from "react";
2
+ import PropTypes from "prop-types";
3
+ import styled from "styled-components";
4
+ import { BsGear } from "react-icons/bs";
5
+
6
+ import List from "../../Reusable Components/ReusableList/ReusableList";
7
+ import RichTextInput from "../../Common Inputs/RichTextInput/RichTextInput";
8
+ import ChatContifgModal from "../../Modals/ChatConfigModal/ChatContifgModal";
9
+
10
+ const listControls = [{ icon: <BsGear />, action: "config", name: "Config" }];
11
+
12
+ const Chat = ({ data, users, title, backgroundColor, community, ...props }) => {
13
+ const [showConfigModal, setShowConfigModal] = useState(false);
14
+
15
+
16
+ const onIconClicked = (action) => {
17
+ if (!props.preview) {
18
+ switch (action) {
19
+ case "config":
20
+ setShowConfigModal(true);
21
+ break;
22
+ default:
23
+ break;
24
+ }
25
+ }
26
+ };
27
+
28
+ const cancelConfig = () => {
29
+ setShowConfigModal(false);
30
+ localStorage.removeItem("formStyles");
31
+ };
32
+
33
+ return (
34
+ <Container backgroundColor={backgroundColor}>
35
+ <List
36
+ listTitle={title || "Chat"}
37
+ type="flat"
38
+ data={data}
39
+ cardStyle="card-style-8"
40
+ iconClicked={onIconClicked}
41
+ listControls={listControls}
42
+ {...props}
43
+ />
44
+ <RichTextInput users={users} />
45
+ <ChatContifgModal
46
+ title={props.title}
47
+ showConfigModal={showConfigModal}
48
+ cancelConfig={cancelConfig}
49
+ community={community}
50
+ data={data}
51
+ users={users}
52
+ />
53
+ </Container>
54
+ );
55
+ };
56
+
57
+ const Container = styled.div`
58
+ width: 100%;
59
+ background-color: ${({ backgroundColor }) =>
60
+ backgroundColor || "transparent"};
61
+ `;
62
+
63
+ Chat.defaultProps = {
64
+ title: "Chat Space",
65
+ };
66
+
67
+ Chat.propTypes = {
68
+ data: PropTypes.array.isRequired,
69
+ title: PropTypes.string,
70
+ users: PropTypes.array,
71
+ backgroundColor: PropTypes.string,
72
+ customCardStyles: PropTypes.object,
73
+ headerStyles: PropTypes.object,
74
+ preview: PropTypes.bool,
75
+ };
76
+
77
+ export default Chat;
@@ -0,0 +1,118 @@
1
+ import React, { useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+
5
+ import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
6
+ import { BsGear } from "react-icons/bs";
7
+ import List from '../../Reusable Components/ReusableList/ReusableList';
8
+ import CreateEventModal from '../../Modals/CreateEventModal/CreateEventModal';
9
+ import EventsConfigModal from '../../Modals/EventsConfigModal/EventsConfigModal';
10
+
11
+ const listControls = [
12
+ { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
13
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
14
+ ]
15
+
16
+ const cardControls = [
17
+ { icon: (<AiFillDelete />), action: 'delete', name: 'Delete Image' },
18
+ ]
19
+
20
+ const EventsList = ({
21
+ events,
22
+ community,
23
+ actions,
24
+ ...props
25
+ }) => {
26
+
27
+ const [showModal, setShowModal] = useState(false);
28
+ const [showConfigModal, setShowConfigModal] = useState(false);
29
+
30
+ const onIconClicked = (action) => {
31
+ if (!props.preview) {
32
+ switch (action) {
33
+ case 'add':
34
+ setShowModal(true)
35
+ break;
36
+ case 'config':
37
+ setShowConfigModal(true)
38
+ break;
39
+ default:
40
+ break;
41
+ }
42
+ }
43
+ }
44
+
45
+ const cardIconClicked = (action, index) => {
46
+ if (!props.preview) {
47
+ props.cardIconClicked(action, index)
48
+ }
49
+ }
50
+
51
+ const cardClicked = (index, props) => {
52
+ if (!props.preview) {
53
+ props.cardClicked(props)
54
+ }
55
+ }
56
+
57
+ const onAddFolder = (event) => {
58
+ setShowModal(false)
59
+ props.onAddEvent(event)
60
+ }
61
+
62
+ const closeModal = () => {
63
+ setShowModal(false);
64
+ }
65
+
66
+ const cancelConfig = () => {
67
+ setShowConfigModal(false);
68
+ localStorage.removeItem('formStyles')
69
+ }
70
+
71
+ return (
72
+ <Container>
73
+ <List
74
+ listTitle={props.title || "My Events"}
75
+ data={events}
76
+ type='flat'
77
+ cardStyle="card-style-11"
78
+ listControls={listControls}
79
+ cardControls={cardControls}
80
+ iconClicked={onIconClicked}
81
+ cardClicked={cardClicked}
82
+ cardIconClicked={cardIconClicked}
83
+ {...props}
84
+ />
85
+ <CreateEventModal
86
+ showModal={showModal}
87
+ onAddFolder={onAddFolder}
88
+ closeModal={closeModal}
89
+ actions={actions}
90
+ />
91
+ <EventsConfigModal
92
+ title={props.title}
93
+ events={events}
94
+ showConfigModal={showConfigModal}
95
+ cancelConfig={cancelConfig}
96
+ community={community}
97
+ />
98
+ </Container>
99
+ )
100
+ }
101
+
102
+ const Container = styled.div`
103
+ width: 100%;
104
+ `
105
+
106
+ EventsList.defaultProps = {};
107
+
108
+ EventsList.propTypes = {
109
+ notes: PropTypes.array.isRequired,
110
+ title: PropTypes.string,
111
+ headerStyles: PropTypes.object,
112
+ customCardStyles: PropTypes.object,
113
+ saveBtnText: PropTypes.string,
114
+ cancelBtnText: PropTypes.string,
115
+ preview: PropTypes.bool
116
+ }
117
+
118
+ export default EventsList
@@ -0,0 +1,125 @@
1
+ import React, { useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+
5
+ import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
6
+ import { BsGear } from "react-icons/bs";
7
+ import List from '../../Reusable Components/ReusableList/ReusableList';
8
+ import CreateNoteModal from '../../Modals/CreateNoteModal/CreateNoteModal';
9
+ import NotesConfigModal from '../../Modals/NotesConfigModal/NotesConfigModal';
10
+
11
+ const listControls = [
12
+ { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
13
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
14
+ ]
15
+
16
+ const cardControls = [
17
+ { icon: (<AiFillDelete />), action: 'delete', name: 'Delete Image' },
18
+ ]
19
+
20
+ const Notes = ({
21
+ notes,
22
+ iconColor,
23
+ cardTitleFontSize,
24
+ cardTitleColor,
25
+ cardPadding,
26
+ community,
27
+ ...props
28
+ }) => {
29
+ const [showModal, setShowModal] = useState(false);
30
+ const [showConfigModal, setShowConfigModal] = useState(false);
31
+
32
+
33
+
34
+ const onIconClicked = (action) => {
35
+ if (!props.preview) {
36
+ switch (action) {
37
+ case 'add':
38
+ setShowModal(true)
39
+ break;
40
+ case 'config':
41
+ setShowConfigModal(true)
42
+ break;
43
+ default:
44
+ break;
45
+ }
46
+ }
47
+ }
48
+
49
+ const cardIconClicked = (action, index) => {
50
+ props.cardIconClicked(action, index)
51
+ }
52
+
53
+ const cardClicked = () => {
54
+ console.log('test')
55
+ }
56
+
57
+ const cancelHandler = () => {
58
+ setShowModal(false)
59
+ }
60
+
61
+ const onAddFolder = (folder) => {
62
+ props.onAddNote(folder)
63
+ setShowModal(false)
64
+ }
65
+
66
+ const closeModal = () => {
67
+ setShowModal(false);
68
+ }
69
+
70
+ const cancelConfig = () => {
71
+ setShowConfigModal(false);
72
+ localStorage.removeItem('formStyles')
73
+ }
74
+
75
+ return (
76
+ <Container>
77
+ <List
78
+ listTitle={props.title || "My Notes"}
79
+ data={notes}
80
+ type='flat'
81
+ cardStyle="card-style-11"
82
+ listControls={listControls}
83
+ cardControls={cardControls}
84
+ iconClicked={onIconClicked}
85
+ cardClicked={cardClicked}
86
+ cardIconClicked={cardIconClicked}
87
+ {...props}
88
+ />
89
+ <CreateNoteModal
90
+ showModal={showModal}
91
+ closeModal={closeModal}
92
+ onAddFolder={onAddFolder}
93
+ cancelHandler={cancelHandler}
94
+ saveBtnText={props.saveBtnText}
95
+ cancelBtnText={props.cancelBtnText}
96
+ />
97
+ <NotesConfigModal
98
+ showConfigModal={showConfigModal}
99
+ cancelConfig={cancelConfig}
100
+ notes={notes}
101
+ community={community}
102
+ />
103
+ </Container>
104
+ )
105
+ }
106
+
107
+ const Container = styled.div`
108
+ width: 100%;
109
+ `
110
+
111
+ Notes.defaultProps = {};
112
+
113
+ Notes.propTypes = {
114
+ notes: PropTypes.array.isRequired,
115
+ iconColor: PropTypes.string,
116
+ cardTitleFontSize: PropTypes.number,
117
+ cardTitleColor: PropTypes.string,
118
+ cardPadding: PropTypes.number,
119
+ saveBtnText: PropTypes.string,
120
+ cancelBtnText: PropTypes.string,
121
+ headerStyles: PropTypes.object,
122
+ customCardStyles: PropTypes.object
123
+ }
124
+
125
+ export default Notes;
@@ -11,7 +11,7 @@ const DetailedPhoto = (props) => {
11
11
  DetailedPhoto.defaultProps = {};
12
12
 
13
13
  DetailedPhoto.propTypes = {
14
-
14
+ img: PropTypes.string
15
15
  }
16
16
 
17
17
  export default DetailedPhoto
@@ -4,15 +4,7 @@ import styled from 'styled-components';
4
4
 
5
5
  import { BsGear } from "react-icons/bs";
6
6
  import ReusableHeader from '../../Reusable Components/ReusableHeader/ReusableHeader';
7
- import Modal from '../../Reusable Components/ReactModal/ReactModal';
8
- import EventPreview from '../../PreviewComponents/EventPreview/EventPreview';
9
-
10
- import Tabs from '../../Reusable Components/Tabs/Tabs';
11
- import Sections from '../../Sections/Sections';
12
- import WidgetContainer from "../../Reusable Components/WidgetContainer/WidgetContainer";
13
- import Community from '../../Reusable Components/Community/Community';
14
- // import styles from '../../styling.json'
15
-
7
+ import EventConfigModal from '../../Modals/EventConfigModal/EventConfigModal';
16
8
 
17
9
  const listControls = [
18
10
  { icon: (<BsGear />), action: 'config', name: 'Config' },
@@ -30,35 +22,10 @@ const Event = ({
30
22
  discColor,
31
23
  discSize,
32
24
  headerStyles,
25
+ community,
33
26
  ...props
34
27
  }) => {
35
28
  const [showConfigModal, setShowConfigModal] = useState(false);
36
- const [centerContext, setCenterContext] = useState(<Event title={title} cover={cover} date={date} disc={disc}/>)
37
-
38
- const formChanged = (values) => {
39
- setCenterContext(<Event title={title} cover={cover} date={date} disc={disc} {...values} />)
40
- }
41
-
42
- let tabs = [
43
- {
44
- title: 'New', id: 'preview'
45
- },
46
- {
47
- title: 'Context', id: 'community'
48
- }
49
- ]
50
-
51
- let sections = [
52
- {
53
- title: 'Styles',
54
- data: [
55
- {
56
- title: 'Styling',
57
- id: 'styling'
58
- }
59
- ]
60
- }
61
- ]
62
29
 
63
30
  const onIconClicked = (action) => {
64
31
  if (!props.preview) {
@@ -71,6 +38,12 @@ const Event = ({
71
38
  }
72
39
  }
73
40
  }
41
+
42
+ const cancelConfig = () => {
43
+ setShowConfigModal(false);
44
+ localStorage.removeItem('formStyles')
45
+ }
46
+
74
47
  return (
75
48
  <Container
76
49
  backgroundColor={backgroundColor}>
@@ -95,44 +68,15 @@ const Event = ({
95
68
  {disc}
96
69
  </Disc>
97
70
  </Details>
98
- <Modal
99
- modalIsOpen={showConfigModal}
100
- closeModal={() => setShowConfigModal(false)}
101
- exitModalButton={(e) => (
102
- <div></div>
103
- )}
104
- >
105
- {/* <Sections
106
- sections={sections}
107
- backgroundColor={'white'}
108
- sectionHeaderStyles={{
109
- titleColor: 'white',
110
- headerBackground: 'transparent'
111
- }}
112
- customCardStyles={{
113
- cardPadding: 6,
114
- cardTitleFontSize: 15,
115
- cardBackgroundColor: '#2c2c2c',
116
- cardTitleColor: 'white',
117
- onHoverBackgroundColor: '#555555',
118
- controlsStyles: {
119
- showOnHover: true,
120
- }
121
- }} /> */}
122
- <Tabs
123
- title="Event Config"
124
- tabs={tabs}
125
- >
126
- <EventPreview
127
- componentProps={{ cover, title, date, disc, preview: true }}
128
- formChanged={formChanged}
129
- id='preview'
130
- />
131
- <Community
132
- center={centerContext}
133
- id="community" />
134
- </Tabs>
135
- </Modal>
71
+ <EventConfigModal
72
+ showConfigModal={showConfigModal}
73
+ cancelConfig={cancelConfig}
74
+ cover={cover}
75
+ title={title}
76
+ date={date}
77
+ disc={disc}
78
+ community={community}
79
+ />
136
80
  </Container>
137
81
  )
138
82
  }
@@ -0,0 +1,122 @@
1
+ import React, { useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
5
+ import { BsGear } from "react-icons/bs";
6
+
7
+ import Gallery from '../../Reusable Components/Gallery/Gallery';
8
+ import CreateFolderModal from '../../Modals/CreateFolderModal/CreateFolderModal';
9
+ import FoldersConfigModal from '../../Modals/FoldersConfigModal/FoldersConfigModal';
10
+
11
+
12
+ const galleryControls = [
13
+ { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
14
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
15
+ ]
16
+
17
+ const cardControls = [
18
+ { icon: (<AiFillDelete />), action: 'delete', name: 'Delete Image' },
19
+ ]
20
+
21
+ const Folders = ({
22
+ folders,
23
+ folderTitle,
24
+ columnsNumber,
25
+ columnGap,
26
+ rowGap,
27
+ cardClicked,
28
+ iconColor,
29
+ community,
30
+ ...props
31
+ }) => {
32
+ const [showModal, setShowModal] = useState(false);
33
+ const [showConfigModal, setShowConfigModal] = useState(false);
34
+
35
+ const cancelConfig = () => {
36
+ setShowConfigModal(false);
37
+ localStorage.removeItem('formStyles')
38
+ }
39
+
40
+ const onIconClicked = (action) => {
41
+ if (!props.preview) {
42
+ switch (action) {
43
+ case 'add':
44
+ setShowModal(true)
45
+ break;
46
+ case 'config':
47
+ setShowConfigModal(true)
48
+ break;
49
+ default:
50
+ break;
51
+ }
52
+ }
53
+ }
54
+
55
+ const cardIconClicked = (action, index) => {
56
+ props.cardIconClicked(action, index)
57
+ }
58
+
59
+ const closeModal = () => {
60
+ setShowModal(false);
61
+ }
62
+
63
+ const onAddFolder = (folder) => {
64
+ props.onAddFolder(folder)
65
+ setShowModal(false)
66
+ }
67
+
68
+ return (
69
+ <Container>
70
+ <Gallery
71
+ galleryTitle={props.title || "Your Folders"}
72
+ data={folders}
73
+ type="flat"
74
+ cardStyle="card-style-10"
75
+ galleryControls={galleryControls}
76
+ iconClicked={onIconClicked}
77
+ cardClicked={cardClicked}
78
+ cardIconClicked={cardIconClicked}
79
+ cardControls={cardControls}
80
+ rowsHeight={140}
81
+ {...props} />
82
+ <CreateFolderModal
83
+ showModal={showModal}
84
+ closeModal={closeModal}
85
+ onAddFolder={onAddFolder}
86
+ />
87
+ <FoldersConfigModal
88
+ showConfigModal={showConfigModal}
89
+ cancelConfig={cancelConfig}
90
+ folders={folders}
91
+ community={community}
92
+ />
93
+ </Container>
94
+ )
95
+ }
96
+
97
+ const Container = styled.div`
98
+ background-color: transparent;
99
+ `
100
+
101
+ Folders.defaultProps = {};
102
+
103
+ Folders.propTypes = {
104
+ folders: PropTypes.array,
105
+ title: PropTypes.string,
106
+ folderTitle: PropTypes.string,
107
+ columnsNumber: PropTypes.number,
108
+ columnGap: PropTypes.number,
109
+ rowGap: PropTypes.number,
110
+ galleryControls: PropTypes.array,
111
+ onIconClicked: PropTypes.func,
112
+ cardClicked: PropTypes.func,
113
+ cardIconClicked: PropTypes.func,
114
+ cardControls: PropTypes.array,
115
+ iconColor: PropTypes.string,
116
+ titleColor: PropTypes.string,
117
+ cardTitleColor: PropTypes.string,
118
+ cardDescriptionColor: PropTypes.string,
119
+ headerStyles: PropTypes.object
120
+ }
121
+
122
+ export default Folders;
@@ -0,0 +1,118 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+
5
+ import List from '../../Reusable Components/ReusableList/ReusableList';
6
+ import AddSongModal from '../../Modals/AddSongModal/AddSongModal';
7
+ import MusicAlbumConfigModal from '../../Modals/MusicAlbumConfigModal/MusicAlbumConfigModal';
8
+ import { AiOutlineFileAdd, AiOutlineDelete } from "react-icons/ai";
9
+ import { BsGear } from "react-icons/bs";
10
+
11
+ const listControls = [
12
+ { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
13
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
14
+ ]
15
+
16
+ const cardControls = [
17
+ { icon: (<AiOutlineDelete />), action: 'delete', name: 'Delete album' },
18
+ ]
19
+
20
+ const ViewAlbum = ({
21
+ album,
22
+ cardBackgroundColor,
23
+ songTitleColor,
24
+ community,
25
+ ...props }) => {
26
+ const [showModal, setShowModal] = useState(false);
27
+ const [showConfigModal, setShowConfigModal] = useState(false);
28
+
29
+
30
+ const onIconClicked = (action) => {
31
+ if (!props.preview) {
32
+ switch (action) {
33
+ case 'add':
34
+ setShowModal(true)
35
+ break;
36
+ case 'config':
37
+ setShowConfigModal(true)
38
+ break;
39
+ default:
40
+ break;
41
+ }
42
+ }
43
+ }
44
+
45
+ const cardIconClicked = (action, index) => {
46
+ if (!props.preview) {
47
+ props.cardIconClicked(action, index)
48
+ }
49
+ }
50
+
51
+ const onAddSong = (song) => {
52
+ setShowModal(false)
53
+ props.onAddSong(song)
54
+ }
55
+
56
+ const closeModal = () => {
57
+ setShowModal(false)
58
+ }
59
+
60
+ const closeConfigModal = () => {
61
+ localStorage.removeItem('formStyles')
62
+ setShowConfigModal(false)
63
+ }
64
+
65
+ return (
66
+ <Container>
67
+ <List
68
+ listTitle={props.title || "My Album"}
69
+ data={album}
70
+ cardStyle="card-style-7"
71
+ type="flat"
72
+ cardClicked={(index) => props.cardClicked(index)}
73
+ iconClicked={onIconClicked}
74
+ listControls={listControls}
75
+ cardControls={cardControls}
76
+ cardIconClicked={cardIconClicked}
77
+ {...props}
78
+ />
79
+ <AddSongModal
80
+ showModal={showModal}
81
+ closeModal={closeModal}
82
+ onAddSong={onAddSong}
83
+ cancelHandler={closeModal}
84
+ />
85
+ <MusicAlbumConfigModal
86
+ showConfigModal={showConfigModal}
87
+ closeModal={closeConfigModal}
88
+ album={album}
89
+ community={community}
90
+ />
91
+ </Container>
92
+ )
93
+ }
94
+
95
+ const Container = styled.div`
96
+ width: 100%;
97
+ `
98
+
99
+ ViewAlbum.defaultProps = {
100
+
101
+ };
102
+
103
+ ViewAlbum.propTypes = {
104
+ album: PropTypes.array,
105
+ onDeleteSong: PropTypes.func,
106
+ onAddSong: PropTypes.func,
107
+ cardClicked: PropTypes.func,
108
+ cardBackgroundColor: PropTypes.string,
109
+ songTitleColor: PropTypes.string,
110
+ title: PropTypes.string,
111
+ saveBtnText: PropTypes.string,
112
+ cancelBtnText: PropTypes.string,
113
+ headerStyles: PropTypes.object,
114
+ customCardStyles: PropTypes.object,
115
+ preview: PropTypes.bool
116
+ };
117
+
118
+ export default ViewAlbum