@mohamed-karawia/library 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/dist/index.js +27 -27
  2. package/dist/stories/Community/Community.js +27 -29
  3. package/dist/stories/Forms/AddPhoto/AddPhoto.js +8 -7
  4. package/dist/stories/Forms/CreateEvent/CreateEvent.js +115 -0
  5. package/dist/stories/Forms/CreateFolder/CreateFolder.js +87 -0
  6. package/dist/stories/Forms/CreateSong/CreateSong.js +98 -0
  7. package/dist/stories/Modals/AddPhotoAlbum/AddPhotoAlbum.js +38 -0
  8. package/dist/stories/Modals/AddPhotoModal/AddPhotoModal.js +40 -0
  9. package/dist/stories/Modals/AddSongModal/AddSongModal.js +41 -0
  10. package/dist/stories/Modals/AddVideoAlbumModal/AddVideoAlbumModal.js +41 -0
  11. package/dist/stories/Modals/AddVideoModal/AddVideoModal.js +39 -0
  12. package/dist/stories/Modals/ChatConfigModal/ChatContifgModal.js +93 -0
  13. package/dist/stories/Modals/CreateEventModal/CreateEventModal.js +42 -0
  14. package/dist/stories/Modals/CreateFolderModal/CreateFolderModal.js +36 -0
  15. package/dist/stories/Modals/CreateMusicAlbumModal/CreateMusicAlbumModal.js +41 -0
  16. package/dist/stories/Modals/CreateNoteModal/CreateNoteModal.js +42 -0
  17. package/dist/stories/Modals/EventConfigModal/EventConfigModal.js +99 -0
  18. package/dist/stories/Modals/EventsConfigModal/EventsConfigModal.js +87 -0
  19. package/dist/stories/Modals/FoldersConfigModal/FoldersConfigModal.js +87 -0
  20. package/dist/stories/Modals/MusicAlbumConfigModal/MusicAlbumConfigModal.js +88 -0
  21. package/dist/stories/Modals/MusicAlbumsConfigModal/MusicAlbumsConfigModal.js +87 -0
  22. package/dist/stories/Modals/NotesConfigModal/NotesConfigModal.js +87 -0
  23. package/dist/stories/Modals/PhotoAlbumConfigModal/PhotoAlbumConfigModal.js +88 -0
  24. package/dist/stories/Modals/PhotoAlbumsConfigModal/PhotoAlbumsConfigModal.js +88 -0
  25. package/dist/stories/Modals/ShowImgModal/ShowImgModal.js +62 -0
  26. package/dist/stories/Modals/VideoAlbumConfigModal/VideoAlbumConfigModal.js +88 -0
  27. package/dist/stories/Modals/VideoAlbumsConfigModal/VideoAlbumsConfigModal.js +89 -0
  28. package/dist/stories/Modals/VideoConfigModal/VideoConfigModal.js +99 -0
  29. package/dist/stories/Pages/Chat/Chat.js +1 -1
  30. package/dist/stories/Pages/Events/Event/Event.js +1 -1
  31. package/dist/stories/Pages/Events/Events/Events.js +1 -1
  32. package/dist/stories/Pages/Library/Folders/Library.js +2 -2
  33. package/dist/stories/Pages/Library/Notes/Notes.js +2 -2
  34. package/dist/stories/Pages/Music/MusicAlbum/Music.js +2 -2
  35. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -2
  36. package/dist/stories/Pages/Photos/Album/Album.js +2 -2
  37. package/dist/stories/Pages/Photos/Albums/Albums.js +2 -2
  38. package/dist/stories/Pages/Video/DetailedVideo/DetailedVideo.js +2 -2
  39. package/dist/stories/Pages/Video/VideoAlbum/Video.js +2 -2
  40. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +6 -4
  41. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +6 -4
  42. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +6 -4
  43. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +6 -4
  44. package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +6 -4
  45. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +7 -6
  46. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +6 -4
  47. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +6 -4
  48. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +6 -4
  49. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +6 -4
  50. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +6 -4
  51. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +6 -4
  52. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +6 -4
  53. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +6 -4
  54. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +6 -4
  55. package/dist/stories/Reusable Components/Comments/Comments.js +58 -0
  56. package/dist/stories/Reusable Components/Sections/Sections.js +67 -0
  57. package/dist/stories/Spaces/Chat/Chat.js +103 -0
  58. package/dist/stories/Spaces/EventsList/EventsList.js +140 -0
  59. package/dist/stories/Spaces/NotesList/NotesList.js +144 -0
  60. package/dist/stories/Spaces/ViewDetailedPhoto/ViewDetailedPhoto.js +24 -0
  61. package/dist/stories/Spaces/ViewEvent/Event.js +146 -0
  62. package/dist/stories/Spaces/ViewFolders/ViewFolders.js +136 -0
  63. package/dist/stories/Spaces/ViewMusicAlbumList/ViewMusicAlbumList.js +136 -0
  64. package/dist/stories/Spaces/ViewMusicAlbums/ViewMusicAlbums.js +130 -0
  65. package/dist/stories/Spaces/ViewNote/ViewNote.js +27 -0
  66. package/dist/stories/Spaces/ViewPhotoAlbumList/ViewPhotoAlbumList.js +231 -0
  67. package/dist/stories/Spaces/ViewPhotoAlbums/ViewPhotoAlbums.js +131 -0
  68. package/dist/stories/Spaces/ViewVideo/ViewVideo.js +169 -0
  69. package/dist/stories/Spaces/ViewVideoAlbumList/ViewVideoAlbumList.js +157 -0
  70. package/dist/stories/Spaces/ViewVideoAlbums/ViewVideoAlbums.js +164 -0
  71. package/dist/stories/Widgets/VideoPlayer/VideoPlayer.js +235 -0
  72. package/dist/stories/helpers/util.js +24 -24
  73. package/dist/stories/store/actions/actions.js +16 -0
  74. package/dist/stories/store/community.js +941 -0
  75. package/dist/stories/store/store.js +9 -4
  76. package/package.json +1 -1
  77. package/src/index.js +16 -16
  78. package/src/stories/Community/Community.jsx +19 -19
  79. package/src/stories/Forms/AddPhoto/AddPhoto.jsx +72 -72
  80. package/src/stories/{Events → Forms}/CreateEvent/CreateEvent.jsx +5 -1
  81. package/src/stories/{Library → Forms}/CreateFolder/CreateFolder.jsx +0 -0
  82. package/src/stories/Forms/{AddSong/AddSong.jsx → CreateSong/CreateSong.jsx} +0 -0
  83. package/src/stories/Modals/AddPhotoAlbum/AddPhotoAlbum.jsx +27 -0
  84. package/src/stories/Modals/AddPhotoModal/AddPhotoModal.jsx +29 -0
  85. package/src/stories/Modals/AddSongModal/AddSongModal.jsx +37 -0
  86. package/src/stories/Modals/AddVideoAlbumModal/AddVideoAlbumModal.jsx +38 -0
  87. package/src/stories/Modals/AddVideoModal/AddVideoModal.jsx +35 -0
  88. package/src/stories/Modals/ChatConfigModal/ChatContifgModal.jsx +77 -0
  89. package/src/stories/Modals/CreateEventModal/CreateEventModal.jsx +30 -0
  90. package/src/stories/Modals/CreateFolderModal/CreateFolderModal.jsx +39 -0
  91. package/src/stories/Modals/CreateMusicAlbumModal/CreateMusicAlbumModal.jsx +37 -0
  92. package/src/stories/Modals/CreateNoteModal/CreateNoteModal.jsx +43 -0
  93. package/src/stories/Modals/EventConfigModal/EventConfigModal.jsx +74 -0
  94. package/src/stories/Modals/EventsConfigModal/EventsConfigModal.jsx +67 -0
  95. package/src/stories/Modals/FoldersConfigModal/FoldersConfigModal.jsx +66 -0
  96. package/src/stories/Modals/MusicAlbumConfigModal/MusicAlbumConfigModal.jsx +69 -0
  97. package/src/stories/Modals/MusicAlbumsConfigModal/MusicAlbumsConfigModal.jsx +73 -0
  98. package/src/stories/Modals/NotesConfigModal/NotesConfigModal.jsx +65 -0
  99. package/src/stories/Modals/PhotoAlbumConfigModal/PhotoAlbumConfigModal.jsx +71 -0
  100. package/src/stories/Modals/PhotoAlbumsConfigModal/PhotoAlbumsConfigModal.jsx +69 -0
  101. package/src/stories/Modals/ShowImgModal/ShowImgModal.jsx +87 -0
  102. package/src/stories/Modals/VideoAlbumConfigModal/VideoAlbumConfigModal.jsx +67 -0
  103. package/src/stories/Modals/VideoAlbumsConfigModal/VideoAlbumsConfigModal.jsx +67 -0
  104. package/src/stories/Modals/VideoConfigModal/VideoConfigModal.jsx +78 -0
  105. package/src/stories/Pages/Chat/Chat.jsx +1 -1
  106. package/src/stories/Pages/Events/Event/Event.jsx +1 -1
  107. package/src/stories/Pages/Events/Events/Events.jsx +1 -1
  108. package/src/stories/Pages/Library/Folders/Library.jsx +1 -1
  109. package/src/stories/Pages/Library/Notes/Notes.jsx +1 -1
  110. package/src/stories/Pages/Music/MusicAlbum/Music.jsx +1 -1
  111. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +1 -1
  112. package/src/stories/Pages/Photos/Album/Album.jsx +1 -1
  113. package/src/stories/Pages/Photos/Albums/Albums.jsx +1 -1
  114. package/src/stories/Pages/Video/DetailedVideo/DetailedVideo.jsx +1 -1
  115. package/src/stories/Pages/Video/VideoAlbum/Video.jsx +1 -1
  116. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +106 -104
  117. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +6 -4
  118. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +106 -104
  119. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +7 -5
  120. package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +6 -4
  121. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +13 -11
  122. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +35 -33
  123. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +17 -15
  124. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +6 -4
  125. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +105 -103
  126. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +7 -5
  127. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +9 -7
  128. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +6 -4
  129. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +6 -4
  130. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +6 -4
  131. package/src/stories/{VideoAlbum → Reusable Components}/Comments/Comments.jsx +0 -0
  132. package/src/stories/{Sections/Sections.jsx → Reusable Components/Sections/Sections.jsx } +1 -1
  133. package/src/stories/Spaces/Chat/Chat.jsx +77 -0
  134. package/src/stories/Spaces/EventsList/EventsList.jsx +118 -0
  135. package/src/stories/{Library/Notes/Notes.jsx → Spaces/NotesList/NotesList.jsx} +20 -66
  136. package/src/stories/{Photo Album/DetailedPhoto/DetailedPhoto.jsx → Spaces/ViewDetailedPhoto/ViewDetailedPhoto.jsx} +1 -1
  137. package/src/stories/{Events/Event → Spaces/ViewEvent}/Event.jsx +10 -74
  138. package/src/stories/Spaces/ViewFolders/ViewFolders.jsx +122 -0
  139. package/src/stories/Spaces/ViewMusicAlbumList/ViewMusicAlbumList.jsx +118 -0
  140. package/src/stories/Spaces/ViewMusicAlbums/ViewMusicAlbums.jsx +108 -0
  141. package/src/stories/{Library → Spaces}/ViewNote/ViewNote.jsx +0 -0
  142. package/src/stories/{Photo Album/ViewAlbum/ViewAlbum.jsx → Spaces/ViewPhotoAlbumList/ViewPhotoAlbumList.jsx} +42 -137
  143. package/src/stories/{Photo Album/ViewAlbums/ViewAlbums.jsx → Spaces/ViewPhotoAlbums/ViewPhotoAlbums.jsx} +16 -55
  144. package/src/stories/{VideoAlbum/VideoSpace/VideoSpace.jsx → Spaces/ViewVideo/ViewVideo.jsx} +15 -48
  145. package/src/stories/{VideoAlbum/ViewAlbum/ViewAlbum.jsx → Spaces/ViewVideoAlbumList/ViewVideoAlbumList.jsx} +14 -57
  146. package/src/stories/{VideoAlbum/AlbumsGallery/AlbumsGallery.jsx → Spaces/ViewVideoAlbums/ViewVideoAlbums.jsx} +14 -52
  147. package/src/stories/{VideoAlbum → Widgets}/VideoPlayer/VideoPlayer.jsx +0 -0
  148. package/src/stories/helpers/util.js +13 -13
  149. package/src/stories/store/actions/actions.js +7 -0
  150. package/src/stories/store/{communities.js → community.js} +0 -0
  151. package/src/stories/store/store.js +3 -4
  152. package/src/stories/Chat/Chat.jsx +0 -154
  153. package/src/stories/Events/EventsList/EventsList.jsx +0 -187
  154. package/src/stories/Library/Folders/Folders.jsx +0 -196
  155. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +0 -172
  156. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +0 -166
@@ -1,187 +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
- community,
29
- ...props
30
- }) => {
31
-
32
- const [showModal, setShowModal] = useState(false);
33
- const [showConfigModal, setShowConfigModal] = useState(false);
34
- const [centerContext, setCenterContext] = useState(<EventsList preview={true} events={events} {...props}/>)
35
-
36
- const formChanged = (values) => {
37
- setCenterContext(<EventsList preview={true} events={events} {...values} />)
38
- }
39
-
40
- let tabs = [
41
- {
42
- title: 'New', id: 'preview'
43
- },
44
- {
45
- title: 'Context', id: 'community'
46
- }
47
- ]
48
-
49
- let sections = [
50
- {
51
- title: 'Styles',
52
- data: [
53
- {
54
- title: 'Styling',
55
- id: 'styling'
56
- }
57
- ]
58
- }
59
- ]
60
-
61
- const onIconClicked = (action) => {
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
- }
73
- }
74
- }
75
-
76
- const cardIconClicked = (action, index) => {
77
- if (!props.preview) {
78
- props.cardIconClicked(action, index)
79
- }
80
- }
81
-
82
- const cardClicked = (index, props) => {
83
- if (!props.preview) {
84
- props.cardClicked(props)
85
- }
86
- }
87
-
88
- const cancelHandler = () => {
89
- setShowModal(false)
90
- }
91
-
92
- const onAddFolder = (event) => {
93
- setShowModal(false)
94
- props.onAddEvent(event)
95
- }
96
-
97
- const cancelConfig = () => {
98
- setShowConfigModal(false);
99
- localStorage.removeItem('formStyles')
100
- }
101
-
102
- return (
103
- <Container>
104
- <List
105
- listTitle={props.title || "My Events"}
106
- data={events}
107
- type='flat'
108
- cardStyle="card-style-11"
109
- listControls={listControls}
110
- cardControls={cardControls}
111
- iconClicked={onIconClicked}
112
- cardClicked={cardClicked}
113
- cardIconClicked={cardIconClicked}
114
- {...props}
115
- />
116
- <Modal
117
- modalIsOpen={showModal}
118
- closeModal={() => setShowModal(false)}
119
- exitModalButton={(e) => (
120
- <div></div>
121
- )}>
122
- <CreateEvent
123
- saveBtnText={props.saveBtnText || 'Create'}
124
- cancelBtnText={props.cancelBtnText || "Cancel"}
125
- saveHandler={onAddFolder}
126
- cancelHandler={cancelHandler}
127
- />
128
- </Modal>
129
- <Modal
130
- modalIsOpen={showConfigModal}
131
- closeModal={cancelConfig}
132
- exitModalButton={(e) => (
133
- <div></div>
134
- )}
135
- >
136
- {/* <Sections
137
- sections={sections}
138
- backgroundColor={'white'}
139
- sectionHeaderStyles={{
140
- titleColor: 'white',
141
- headerBackground: 'transparent'
142
- }}
143
- customCardStyles={{
144
- cardPadding: 6,
145
- cardTitleFontSize: 15,
146
- cardBackgroundColor: '#2c2c2c',
147
- cardTitleColor: 'white',
148
- onHoverBackgroundColor: '#555555',
149
- controlsStyles: {
150
- showOnHover: true,
151
- }
152
- }} /> */}
153
- <Tabs
154
- title="Events Config"
155
- tabs={tabs}>
156
- <EventsPreview
157
- componentProps={{ events, title: props.title || "My Events", preview: true }}
158
- formChanged={formChanged}
159
- id='preview'
160
- />
161
- <Community
162
- center={centerContext}
163
- community={community}
164
- id="community" />
165
- </Tabs>
166
- </Modal>
167
- </Container>
168
- )
169
- }
170
-
171
- const Container = styled.div`
172
- width: 100%;
173
- `
174
-
175
- EventsList.defaultProps = {};
176
-
177
- EventsList.propTypes = {
178
- notes: PropTypes.array.isRequired,
179
- title: PropTypes.string,
180
- headerStyles: PropTypes.object,
181
- customCardStyles: PropTypes.object,
182
- saveBtnText: PropTypes.string,
183
- cancelBtnText: PropTypes.string,
184
- preview: PropTypes.bool
185
- }
186
-
187
- export default EventsList
@@ -1,196 +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
- community,
35
- ...props
36
- }) => {
37
- const [showModal, setShowModal] = useState(false);
38
- const [showConfigModal, setShowConfigModal] = useState(false);
39
- const [centerContext, setCenterContext] = useState(<Folders preview={true} folders={folders} />)
40
-
41
- const formChanged = (values) => {
42
- setCenterContext(<Folders preview={true} folders={folders} {...values} />)
43
- }
44
-
45
- let tabs = [
46
- {
47
- title: 'New', id: 'preview'
48
- },
49
- {
50
- title: 'Context', id: 'community'
51
- }
52
- ]
53
-
54
- const sections = [
55
- {
56
- title: 'Styles',
57
- data: [
58
- {
59
- title: 'Styling', component: (<Tabs
60
- title="Folders Config"
61
- tabs={tabs}
62
- />)
63
- }
64
- ]
65
- }
66
- ]
67
-
68
- const cancelConfig = () => {
69
- setShowConfigModal(false);
70
- localStorage.removeItem('formStyles')
71
- }
72
-
73
- const onIconClicked = (action) => {
74
- if (!props.preview) {
75
- switch (action) {
76
- case 'add':
77
- setShowModal(true)
78
- break;
79
- case 'config':
80
- setShowConfigModal(true)
81
- break;
82
- default:
83
- break;
84
- }
85
- }
86
- }
87
-
88
- const cardIconClicked = (action, index) => {
89
- props.cardIconClicked(action, index)
90
- }
91
-
92
- const cancelHandler = () => {
93
- setShowModal(false)
94
- }
95
-
96
- const onAddFolder = (folder) => {
97
- props.onAddFolder(folder)
98
- setShowModal(false)
99
- }
100
-
101
- return (
102
- <Container>
103
- <Gallery
104
- galleryTitle={props.title || "Your Folders"}
105
- data={folders}
106
- type="flat"
107
- cardStyle="card-style-10"
108
- galleryControls={galleryControls}
109
- iconClicked={onIconClicked}
110
- cardClicked={cardClicked}
111
- cardIconClicked={cardIconClicked}
112
- cardControls={cardControls}
113
- rowsHeight={140}
114
- {...props} />
115
- <Modal
116
- modalIsOpen={showModal}
117
- closeModal={() => setShowModal(false)}
118
- exitModalButton={(e) => (
119
- <div></div>
120
- )}
121
- >
122
- <CreateFolder
123
- saveBtnText="Create"
124
- cancelBtnText="Cancel"
125
- saveHandler={onAddFolder}
126
- cancelHandler={cancelHandler}
127
- />
128
- </Modal>
129
- <Modal
130
- modalIsOpen={showConfigModal}
131
- closeModal={cancelConfig}
132
- exitModalButton={(e) => (
133
- <div></div>
134
- )}
135
- >
136
- {/* <Sections
137
- sections={sections}
138
- backgroundColor={'white'}
139
- sectionHeaderStyles={{
140
- titleColor: 'white',
141
- headerBackground: 'transparent'
142
- }}
143
- customCardStyles={{
144
- cardPadding: 6,
145
- cardTitleFontSize: 15,
146
- cardBackgroundColor: '#2c2c2c',
147
- cardTitleColor: 'white',
148
- onHoverBackgroundColor: '#555555',
149
- controlsStyles: {
150
- showOnHover: true,
151
- }
152
- }} /> */}
153
- <Tabs
154
- title="Folders Config"
155
- tabs={tabs}>
156
- <FoldersPreview
157
- componentProps={{ folders, title: props.title || "Your Folders", preview: true }}
158
- formChanged={formChanged}
159
- id='preview'
160
- />
161
- <Community
162
- center={centerContext}
163
- community={community}
164
- id="community" />
165
- </Tabs>
166
- </Modal>
167
- </Container>
168
- )
169
- }
170
-
171
- const Container = styled.div`
172
- background-color: transparent;
173
- `
174
-
175
- Folders.defaultProps = {};
176
-
177
- Folders.propTypes = {
178
- folders: PropTypes.array,
179
- title: PropTypes.string,
180
- folderTitle: PropTypes.string,
181
- columnsNumber: PropTypes.number,
182
- columnGap: PropTypes.number,
183
- rowGap: PropTypes.number,
184
- galleryControls: PropTypes.array,
185
- onIconClicked: PropTypes.func,
186
- cardClicked: PropTypes.func,
187
- cardIconClicked: PropTypes.func,
188
- cardControls: PropTypes.array,
189
- iconColor: PropTypes.string,
190
- titleColor: PropTypes.string,
191
- cardTitleColor: PropTypes.string,
192
- cardDescriptionColor: PropTypes.string,
193
- headerStyles: PropTypes.object
194
- }
195
-
196
- export default Folders;
@@ -1,172 +0,0 @@
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 Modal from '../../Reusable Components/ReactModal/ReactModal';
7
-
8
- import { AiOutlineFileAdd, AiOutlineDelete } from "react-icons/ai";
9
- import { BsGear } from "react-icons/bs";
10
- import AddSong from '../../Forms/AddSong/AddSong';
11
- import Tabs from '../../Reusable Components/Tabs/Tabs';
12
- import Sections from '../../Sections/Sections';
13
- import MusicAlbumPreview from '../../PreviewComponents/MusicAlbumPreview/MusicAlbumPreview';
14
- import WidgetContainer from "../../Reusable Components/WidgetContainer/WidgetContainer";
15
- import Community from '../../Reusable Components/Community/Community';
16
- import { SPACES } from '../../Pages/ViewWorld/constatnts';
17
- // import styles from '../../styling.json'
18
-
19
- const listControls = [
20
- { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
21
- { icon: (<BsGear />), action: 'config', name: 'Config' },
22
- ]
23
-
24
- const cardControls = [
25
- { icon: (<AiOutlineDelete />), action: 'delete', name: 'Delete album' },
26
- ]
27
-
28
- const ViewAlbum = ({
29
- album,
30
- cardBackgroundColor,
31
- songTitleColor,
32
- community,
33
- ...props }) => {
34
- const [showModal, setShowModal] = useState(false);
35
- const [showConfigModal, setShowConfigModal] = useState(false);
36
- const [centerContext, setCenterContext] = useState(<ViewAlbum preview={true} album={album} />)
37
-
38
- const formChanged = (values) => {
39
- console.log('context changed')
40
- setCenterContext(<ViewAlbum preview={true} album={album} {...values} />)
41
- }
42
-
43
-
44
- let tabs = [
45
- {
46
- title: 'New', id: 'preview'
47
- },
48
- {
49
- title: 'Context', id: 'community'
50
- }
51
- ]
52
-
53
- let sections = [
54
- {
55
- title: 'Styles',
56
- data: [
57
- {
58
- title: 'Styling',
59
- id: 'styling'
60
- }
61
- ]
62
- }
63
- ]
64
-
65
- const onIconClicked = (action) => {
66
- if (!props.preview) {
67
- switch (action) {
68
- case 'add':
69
- setShowModal(true)
70
- break;
71
- case 'config':
72
- setShowConfigModal(true)
73
- break;
74
- default:
75
- break;
76
- }
77
- }
78
- }
79
-
80
- const cardIconClicked = (action, index) => {
81
- if (!props.preview) {
82
- props.cardIconClicked(action, index)
83
- }
84
- }
85
-
86
- const onAddSong = (song) => {
87
- setShowModal(false)
88
- props.onAddSong(song)
89
- }
90
-
91
- const cancelHandler = () => {
92
- setShowModal(false)
93
- }
94
-
95
- return (
96
- <Container>
97
- <List
98
- listTitle={props.title || "My Album"}
99
- data={album}
100
- cardStyle="card-style-7"
101
- type="flat"
102
- cardClicked={(index) => props.cardClicked(index)}
103
- iconClicked={onIconClicked}
104
- listControls={listControls}
105
- cardControls={cardControls}
106
- cardIconClicked={cardIconClicked}
107
- {...props}
108
- />
109
- <Modal
110
- modalIsOpen={showModal}
111
- closeModal={() => setShowModal(false)}
112
- exitModalButton={(e) => (
113
- <div></div>
114
- )}>
115
- <AddSong
116
- saveHandler={onAddSong}
117
- cancelHandler={cancelHandler}
118
- saveBtnText={props.saveBtnText || "Create"}
119
- cancelBtnText={props.cancelBtnText || "Cancel"} />
120
- </Modal>
121
- <Modal
122
- modalIsOpen={showConfigModal}
123
- closeModal={() => {
124
- localStorage.removeItem('formStyles')
125
- setShowConfigModal(false)
126
- }}
127
- exitModalButton={(e) => (
128
- <div></div>
129
- )}
130
- >
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>
144
- </Modal>
145
- </Container>
146
- )
147
- }
148
-
149
- const Container = styled.div`
150
- width: 100%;
151
- `
152
-
153
- ViewAlbum.defaultProps = {
154
-
155
- };
156
-
157
- ViewAlbum.propTypes = {
158
- album: PropTypes.array,
159
- onDeleteSong: PropTypes.func,
160
- onAddSong: PropTypes.func,
161
- cardClicked: PropTypes.func,
162
- cardBackgroundColor: PropTypes.string,
163
- songTitleColor: PropTypes.string,
164
- title: PropTypes.string,
165
- saveBtnText: PropTypes.string,
166
- cancelBtnText: PropTypes.string,
167
- headerStyles: PropTypes.object,
168
- customCardStyles: PropTypes.object,
169
- preview: PropTypes.bool
170
- };
171
-
172
- export default ViewAlbum