@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
@@ -1,180 +0,0 @@
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 Modal from '../../Reusable Components/ReactModal/ReactModal';
9
- import CreateEvent from '../CreateEvent/CreateEvent';
10
- import EventsPreview from '../../PreviewComponents/EventsPreview/EventsPreview';
11
- // import { Events } from './EventsList.stories';
12
- // import { eventsList } from '../../Pages/Events/Events/Events.stories';
13
- import Tabs from '../../Reusable Components/Tabs/Tabs';
14
- import Sections from '../../Sections/Sections';
15
- import Community from '../../Reusable Components/Community/Community';
16
-
17
- const listControls = [
18
- { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
19
- { icon: (<BsGear />), action: 'config', name: 'Config' },
20
- ]
21
-
22
- const cardControls = [
23
- { icon: (<AiFillDelete />), action: 'delete', name: 'Delete Image' },
24
- ]
25
-
26
- const EventsList = ({
27
- events,
28
- ...props
29
- }) => {
30
-
31
- const [showModal, setShowModal] = useState(false);
32
- const [showConfigModal, setShowConfigModal] = useState(false);
33
- const [centerContext, setCenterContext] = useState(<EventsList events={events} />)
34
-
35
- const formChanged = (values) => {
36
- setCenterContext(<EventsList events={events} {...values} />)
37
- }
38
-
39
- let tabs = [
40
- {
41
- title: 'New', id: 'preview'
42
- },
43
- {
44
- title: 'Context', id: 'community'
45
- }
46
- ]
47
-
48
- let sections = [
49
- {
50
- title: 'Styles',
51
- data: [
52
- {
53
- title: 'Styling',
54
- id: 'styling'
55
- }
56
- ]
57
- }
58
- ]
59
-
60
- const onIconClicked = (action) => {
61
- if (!props.preview) {
62
- switch (action) {
63
- case 'add':
64
- setShowModal(true)
65
- break;
66
- case 'config':
67
- setShowConfigModal(true)
68
- break;
69
- default:
70
- break;
71
- }
72
- }
73
- }
74
-
75
- const cardIconClicked = (action, index) => {
76
- if (!props.preview) {
77
- props.cardIconClicked(action, index)
78
- }
79
- }
80
-
81
- const cardClicked = (index, props) => {
82
- if (!props.preview) {
83
- props.cardClicked(props)
84
- }
85
- }
86
-
87
- const cancelHandler = () => {
88
- setShowModal(false)
89
- }
90
-
91
- const onAddFolder = (event) => {
92
- setShowModal(false)
93
- props.onAddEvent(event)
94
- }
95
-
96
- return (
97
- <Container>
98
- <List
99
- listTitle={props.title || "My Events"}
100
- data={events}
101
- type='flat'
102
- cardStyle="card-style-11"
103
- listControls={listControls}
104
- cardControls={cardControls}
105
- iconClicked={onIconClicked}
106
- cardClicked={cardClicked}
107
- cardIconClicked={cardIconClicked}
108
- {...props}
109
- />
110
- <Modal
111
- modalIsOpen={showModal}
112
- closeModal={() => setShowModal(false)}
113
- exitModalButton={(e) => (
114
- <div></div>
115
- )}>
116
- <CreateEvent
117
- saveBtnText={props.saveBtnText || 'Create'}
118
- cancelBtnText={props.cancelBtnText || "Cancel"}
119
- saveHandler={onAddFolder}
120
- cancelHandler={cancelHandler}
121
- />
122
- </Modal>
123
- <Modal
124
- modalIsOpen={showConfigModal}
125
- closeModal={() => setShowConfigModal(false)}
126
- exitModalButton={(e) => (
127
- <div></div>
128
- )}
129
- >
130
- {/* <Sections
131
- sections={sections}
132
- backgroundColor={'white'}
133
- sectionHeaderStyles={{
134
- titleColor: 'white',
135
- headerBackground: 'transparent'
136
- }}
137
- customCardStyles={{
138
- cardPadding: 6,
139
- cardTitleFontSize: 15,
140
- cardBackgroundColor: '#2c2c2c',
141
- cardTitleColor: 'white',
142
- onHoverBackgroundColor: '#555555',
143
- controlsStyles: {
144
- showOnHover: true,
145
- }
146
- }} /> */}
147
- <Tabs
148
- title="Event Config"
149
- tabs={tabs}>
150
- <EventsPreview
151
- componentProps={{ events, title: props.title || "My Events", preview: true }}
152
- formChanged={formChanged}
153
- id='preview'
154
- />
155
- <Community
156
- center={centerContext}
157
- id="community" />
158
- </Tabs>
159
- </Modal>
160
- </Container>
161
- )
162
- }
163
-
164
- const Container = styled.div`
165
- width: 100%;
166
- `
167
-
168
- EventsList.defaultProps = {};
169
-
170
- EventsList.propTypes = {
171
- notes: PropTypes.array.isRequired,
172
- title: PropTypes.string,
173
- headerStyles: PropTypes.object,
174
- customCardStyles: PropTypes.object,
175
- saveBtnText: PropTypes.string,
176
- cancelBtnText: PropTypes.string,
177
- preview: PropTypes.bool
178
- }
179
-
180
- export default EventsList
@@ -1,187 +0,0 @@
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 Modal from '../../Reusable Components/ReactModal/ReactModal';
9
- import CreateFolder from '../CreateFolder/CreateFolder';
10
- import Tabs from '../../Reusable Components/Tabs/Tabs';
11
- import Sections from '../../Sections/Sections'
12
- import FoldersPreview from '../../PreviewComponents/FoldersPreview/FoldersPreview';
13
- // import { Folders as Context } from '../../Pages/Library/Folders/Library.stories';
14
- // import { ViewFolders } from './Folders.stories';
15
- import Community from '../../Reusable Components/Community/Community';
16
-
17
- const galleryControls = [
18
- { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
19
- { icon: (<BsGear />), action: 'config', name: 'Config' },
20
- ]
21
-
22
- const cardControls = [
23
- { icon: (<AiFillDelete />), action: 'delete', name: 'Delete Image' },
24
- ]
25
-
26
- const Folders = ({
27
- folders,
28
- folderTitle,
29
- columnsNumber,
30
- columnGap,
31
- rowGap,
32
- cardClicked,
33
- iconColor,
34
- ...props
35
- }) => {
36
- const [showModal, setShowModal] = useState(false);
37
- const [showConfigModal, setShowConfigModal] = useState(false);
38
- const [centerContext, setCenterContext] = useState(<Folders folders={folders} />)
39
-
40
- const formChanged = (values) => {
41
- setCenterContext(<Folders folders={folders} {...values} />)
42
- }
43
-
44
- let tabs = [
45
- {
46
- title: 'New', id: 'preview'
47
- },
48
- {
49
- title: 'Context', id: 'community'
50
- }
51
- ]
52
-
53
- const sections = [
54
- {
55
- title: 'Styles',
56
- data: [
57
- {
58
- title: 'Styling', component: (<Tabs
59
- title="Folders Config"
60
- tabs={tabs}
61
- />)
62
- }
63
- ]
64
- }
65
- ]
66
-
67
- const onIconClicked = (action) => {
68
- switch (action) {
69
- case 'add':
70
- setShowModal(true)
71
- break;
72
- case 'config':
73
- setShowConfigModal(true)
74
- break;
75
- default:
76
- break;
77
- }
78
- }
79
-
80
- const cardIconClicked = (action, index) => {
81
- props.cardIconClicked(action, index)
82
- }
83
-
84
- const cancelHandler = () => {
85
- setShowModal(false)
86
- }
87
-
88
- const onAddFolder = (folder) => {
89
- props.onAddFolder(folder)
90
- setShowModal(false)
91
- }
92
-
93
- return (
94
- <Container>
95
- <Gallery
96
- galleryTitle={props.title || "Your Folders"}
97
- data={folders}
98
- type="flat"
99
- cardStyle="card-style-10"
100
- galleryControls={galleryControls}
101
- iconClicked={onIconClicked}
102
- cardClicked={cardClicked}
103
- cardIconClicked={cardIconClicked}
104
- cardControls={cardControls}
105
- rowsHeight={140}
106
- {...props} />
107
- <Modal
108
- modalIsOpen={showModal}
109
- closeModal={() => setShowModal(false)}
110
- exitModalButton={(e) => (
111
- <div></div>
112
- )}
113
- >
114
- <CreateFolder
115
- saveBtnText="Create"
116
- cancelBtnText="Cancel"
117
- saveHandler={onAddFolder}
118
- cancelHandler={cancelHandler}
119
- />
120
- </Modal>
121
- <Modal
122
- modalIsOpen={showConfigModal}
123
- closeModal={() => setShowConfigModal(false)}
124
- exitModalButton={(e) => (
125
- <div></div>
126
- )}
127
- >
128
- {/* <Sections
129
- sections={sections}
130
- backgroundColor={'white'}
131
- sectionHeaderStyles={{
132
- titleColor: 'white',
133
- headerBackground: 'transparent'
134
- }}
135
- customCardStyles={{
136
- cardPadding: 6,
137
- cardTitleFontSize: 15,
138
- cardBackgroundColor: '#2c2c2c',
139
- cardTitleColor: 'white',
140
- onHoverBackgroundColor: '#555555',
141
- controlsStyles: {
142
- showOnHover: true,
143
- }
144
- }} /> */}
145
- <Tabs
146
- title="Event Config"
147
- tabs={tabs}>
148
- <FoldersPreview
149
- componentProps={{ folders, title: props.title || "Your Folders" }}
150
- formChanged={formChanged}
151
- id='preview'
152
- />
153
- <Community
154
- center={centerContext}
155
- id="community" />
156
- </Tabs>
157
- </Modal>
158
- </Container>
159
- )
160
- }
161
-
162
- const Container = styled.div`
163
- background-color: transparent;
164
- `
165
-
166
- Folders.defaultProps = {};
167
-
168
- Folders.propTypes = {
169
- folders: PropTypes.array,
170
- title: PropTypes.string,
171
- folderTitle: PropTypes.string,
172
- columnsNumber: PropTypes.number,
173
- columnGap: PropTypes.number,
174
- rowGap: PropTypes.number,
175
- galleryControls: PropTypes.array,
176
- onIconClicked: PropTypes.func,
177
- cardClicked: PropTypes.func,
178
- cardIconClicked: PropTypes.func,
179
- cardControls: PropTypes.array,
180
- iconColor: PropTypes.string,
181
- titleColor: PropTypes.string,
182
- cardTitleColor: PropTypes.string,
183
- cardDescriptionColor: PropTypes.string,
184
- headerStyles: PropTypes.object
185
- }
186
-
187
- export default Folders;
@@ -1,161 +0,0 @@
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 Modal from '../../Reusable Components/ReactModal/ReactModal';
9
- import CreateFolder from '../CreateFolder/CreateFolder';
10
- import Tabs from '../../Reusable Components/Tabs/Tabs';
11
- import Sections from '../../Sections/Sections'
12
- import NotesPreview from '../../PreviewComponents/NotesPreview/NotesPreview';
13
- import Community from '../../Reusable Components/Community/Community';
14
-
15
- const listControls = [
16
- { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
17
- { icon: (<BsGear />), action: 'config', name: 'Config' },
18
- ]
19
-
20
- const cardControls = [
21
- { icon: (<AiFillDelete />), action: 'delete', name: 'Delete Image' },
22
- ]
23
-
24
- const Notes = ({
25
- notes,
26
- iconColor,
27
- cardTitleFontSize,
28
- cardTitleColor,
29
- cardPadding,
30
- ...props
31
- }) => {
32
- const [showModal, setShowModal] = useState(false);
33
- const [showConfigModal, setShowConfigModal] = useState(false);
34
- const [centerContext, setCenterContext] = useState(<Notes notes={notes} />)
35
-
36
- const formChanged = (values) => {
37
- setCenterContext(<Notes notes={notes} {...values} />)
38
- }
39
-
40
- let tabs = [
41
- {
42
- title: 'New', id: 'preview'
43
- },
44
- {
45
- title: 'Context', id: 'community'
46
- }
47
- ]
48
-
49
- const sections = [
50
- {
51
- title: 'Styles',
52
- data: [
53
- {
54
- title: 'Styling', component: (<Tabs
55
- title="Notes Config"
56
- tabs={tabs}
57
- />)
58
- }
59
- ]
60
- }
61
- ]
62
-
63
- const onIconClicked = (action) => {
64
- switch (action) {
65
- case 'add':
66
- setShowModal(true)
67
- break;
68
- case 'config':
69
- setShowConfigModal(true)
70
- break;
71
- default:
72
- break;
73
- }
74
- }
75
-
76
- const cardIconClicked = (action, index) => {
77
- props.cardIconClicked(action, index)
78
- }
79
-
80
- const cardClicked = () => {
81
- console.log('test')
82
- }
83
-
84
- const cancelHandler = () => {
85
- setShowModal(false)
86
- }
87
-
88
- const onAddFolder = (folder) => {
89
- props.onAddNote(folder)
90
- setShowModal(false)
91
- }
92
-
93
- return (
94
- <Container>
95
- <List
96
- listTitle={props.title || "My Notes"}
97
- data={notes}
98
- type='flat'
99
- cardStyle="card-style-11"
100
- listControls={listControls}
101
- cardControls={cardControls}
102
- iconClicked={onIconClicked}
103
- cardClicked={cardClicked}
104
- cardIconClicked={cardIconClicked}
105
- {...props}
106
- />
107
- <Modal
108
- modalIsOpen={showModal}
109
- closeModal={() => setShowModal(false)}
110
- exitModalButton={(e) => (
111
- <div></div>
112
- )}>
113
- <CreateFolder
114
- saveBtnText={props.saveBtnText || "Create"}
115
- cancelBtnText={props.cancelBtnText || "Cancel"}
116
- saveHandler={onAddFolder}
117
- cancelHandler={cancelHandler}
118
- />
119
- </Modal>
120
- <Modal
121
- modalIsOpen={showConfigModal}
122
- closeModal={() => setShowConfigModal(false)}
123
- exitModalButton={(e) => (
124
- <div></div>
125
- )}
126
- >
127
- <Tabs
128
- title="Event Config"
129
- tabs={tabs}>
130
- <NotesPreview
131
- componentProps={{ notes, title: props.title || "Your Notes" }}
132
- formChanged={formChanged }
133
- />
134
- <Community
135
- center={centerContext}
136
- id="community" />
137
- </Tabs>
138
- </Modal>
139
- </Container>
140
- )
141
- }
142
-
143
- const Container = styled.div`
144
- width: 100%;
145
- `
146
-
147
- Notes.defaultProps = {};
148
-
149
- Notes.propTypes = {
150
- notes: PropTypes.array.isRequired,
151
- iconColor: PropTypes.string,
152
- cardTitleFontSize: PropTypes.number,
153
- cardTitleColor: PropTypes.string,
154
- cardPadding: PropTypes.number,
155
- saveBtnText: PropTypes.string,
156
- cancelBtnText: PropTypes.string,
157
- headerStyles: PropTypes.object,
158
- customCardStyles: PropTypes.object
159
- }
160
-
161
- export default Notes;