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