@mohamed-karawia/library 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/stories/Chat/Chat.js +120 -3
- package/dist/stories/Common Inputs/Picker/Picker.js +61 -0
- package/dist/stories/Common Inputs/TextField/TextField.js +3 -1
- package/dist/stories/Community/Community.js +137 -0
- package/dist/stories/Events/Event/Event.js +116 -4
- package/dist/stories/Events/EventsList/EventsList.js +95 -16
- package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
- package/dist/stories/Library/Folders/Folders.js +80 -1
- package/dist/stories/Library/Notes/Notes.js +75 -1
- package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
- package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +134 -9
- package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +65 -23
- package/dist/stories/Navbar/Navbar.js +1 -1
- package/dist/stories/Pages/Events/Event/Event.js +14 -5
- package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -15
- package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +76 -9
- package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +80 -9
- package/dist/stories/Preview/Preview.js +1 -0
- package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +193 -0
- package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +158 -0
- package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +192 -0
- package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +182 -0
- package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +177 -0
- package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +181 -0
- package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +153 -0
- package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +112 -0
- package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +173 -0
- package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +189 -0
- package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +189 -0
- package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +197 -0
- package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +189 -0
- package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +175 -0
- package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +172 -0
- package/dist/stories/PreviewComponents/globalStyles.js +26 -0
- package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +4 -3
- package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +8 -4
- package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.js +10 -4
- package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.js +4 -2
- package/dist/stories/Reusable Components/Cards/globalCardStyles.js +2 -2
- package/dist/stories/Reusable Components/Community/Community.js +76 -0
- package/dist/stories/Reusable Components/Gallery/Gallery.js +12 -17
- package/dist/stories/Reusable Components/ReactModal/ReactModal.js +11 -30
- package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +19 -2
- package/dist/stories/Reusable Components/ReusableList/ReusableList.js +9 -5
- package/dist/stories/Reusable Components/Tabs/Tabs.js +68 -0
- package/dist/stories/Sections/Sections.js +8 -2
- package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +77 -18
- package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +96 -3
- package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +77 -1
- package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +16 -10
- package/dist/stories/Widgets/SpacesListWidget/SpacesListWidget.js +115 -0
- package/dist/stories/Widgets/UsersWidget/UsersWidget.js +30 -0
- package/dist/stories/helpers/util.js +36 -3
- package/dist/stories/store/communities.js +943 -0
- package/dist/stories/store/store.js +44 -0
- package/package.json +5 -2
- package/src/stories/Chat/Chat.jsx +104 -5
- package/src/stories/Common Inputs/Picker/Picker.jsx +47 -0
- package/src/stories/Common Inputs/TextField/TextField.jsx +1 -1
- package/src/stories/Community/Community.jsx +110 -0
- package/src/stories/Events/Event/Event.jsx +97 -4
- package/src/stories/Events/EventsList/EventsList.jsx +91 -17
- package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
- package/src/stories/Library/Folders/Folders.jsx +79 -1
- package/src/stories/Library/Notes/Notes.jsx +57 -1
- package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
- package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +125 -11
- package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +56 -26
- package/src/stories/Navbar/Navbar.jsx +1 -1
- package/src/stories/Pages/Events/Event/Event.jsx +12 -4
- package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +0 -13
- package/src/stories/Pages/ViewWorld/styles.json +1 -1
- package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +57 -4
- package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +62 -9
- package/src/stories/Preview/Preview.jsx +9 -1
- package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +132 -0
- package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +116 -0
- package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +132 -0
- package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +127 -0
- package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +124 -0
- package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +126 -0
- package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +113 -0
- package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +93 -0
- package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +122 -0
- package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +129 -0
- package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +129 -0
- package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +138 -0
- package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +129 -0
- package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +124 -0
- package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +125 -0
- package/src/stories/PreviewComponents/globalStyles.js +20 -0
- package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +5 -2
- package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -5
- package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.jsx +12 -6
- package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.jsx +2 -2
- package/src/stories/Reusable Components/Cards/globalCardStyles.js +2 -1
- package/src/stories/Reusable Components/Community/Community.jsx +70 -0
- package/src/stories/Reusable Components/Gallery/Gallery.jsx +10 -9
- package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +3 -25
- package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +18 -6
- package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +9 -4
- package/src/stories/Reusable Components/Tabs/Tabs.jsx +67 -0
- package/src/stories/Sections/Sections.jsx +5 -2
- package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +57 -16
- package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +70 -1
- package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +62 -3
- package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +13 -6
- package/src/stories/Widgets/SpacesListWidget/SpacesListWidget.jsx +78 -0
- package/src/stories/Widgets/UsersWidget/UsersWidget.jsx +20 -0
- package/src/stories/helpers/util.js +24 -2
- package/src/stories/store/communities.js +705 -0
- package/src/stories/store/store.js +33 -0
- package/src/stories/styling.json +92 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import * as Yup from 'yup';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import ReusableForm from '../../Reusable Components/ReusableForm/ReusableForm';
|
7
|
+
import TextField from '../../Common Inputs/TextField/TextField';
|
8
|
+
|
9
|
+
const CreateSpace = (props) => {
|
10
|
+
|
11
|
+
const initialValues = {
|
12
|
+
title: ''
|
13
|
+
}
|
14
|
+
|
15
|
+
const formSchema = Yup.object().shape({
|
16
|
+
title: Yup.string()
|
17
|
+
.required("Required"),
|
18
|
+
});
|
19
|
+
|
20
|
+
const sections = [
|
21
|
+
{
|
22
|
+
title: "Space Details",
|
23
|
+
body: [
|
24
|
+
(<TextField label="Title" name="title" />),
|
25
|
+
],
|
26
|
+
hideTitle: false
|
27
|
+
},
|
28
|
+
]
|
29
|
+
|
30
|
+
const onCreate = (values) => {
|
31
|
+
props.saveHandler(values)
|
32
|
+
}
|
33
|
+
|
34
|
+
const cancelHandler = () => {
|
35
|
+
props.cancelHandler()
|
36
|
+
}
|
37
|
+
return (
|
38
|
+
<Container>
|
39
|
+
<ReusableForm
|
40
|
+
formTitle={props.title || "Create Space"}
|
41
|
+
initialValues={initialValues}
|
42
|
+
formSchema={formSchema}
|
43
|
+
sections={sections}
|
44
|
+
saveBtnText={props.saveBtnText || 'Create'}
|
45
|
+
cancelBtnText={props.cancelBtnText || 'Cancel'}
|
46
|
+
saveHandler={onCreate}
|
47
|
+
cancelHandler={cancelHandler}
|
48
|
+
headerStyles={{
|
49
|
+
padding: 10,
|
50
|
+
headerBackground: 'black',
|
51
|
+
titleColor: '#ffff',
|
52
|
+
}}
|
53
|
+
sectionPadding={10}
|
54
|
+
bodyRowGap={10}
|
55
|
+
{...props.formStyles}
|
56
|
+
/>
|
57
|
+
</Container>
|
58
|
+
);
|
59
|
+
};
|
60
|
+
|
61
|
+
const Container = styled.div`
|
62
|
+
|
63
|
+
`
|
64
|
+
|
65
|
+
CreateSpace.defaultProps = {};
|
66
|
+
|
67
|
+
CreateSpace.propTypes = {
|
68
|
+
title: PropTypes.string,
|
69
|
+
saveBtnText: PropTypes.string,
|
70
|
+
cancelBtnText: PropTypes.string
|
71
|
+
}
|
72
|
+
|
73
|
+
export default CreateSpace;
|
@@ -2,13 +2,21 @@ import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import styled from 'styled-components';
|
4
4
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
5
|
+
import { BsGear } from "react-icons/bs";
|
5
6
|
|
6
7
|
import Gallery from '../../Reusable Components/Gallery/Gallery';
|
7
8
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
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';
|
9
16
|
|
10
17
|
const galleryControls = [
|
11
18
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
|
19
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
12
20
|
]
|
13
21
|
|
14
22
|
const cardControls = [
|
@@ -26,12 +34,44 @@ const Folders = ({
|
|
26
34
|
...props
|
27
35
|
}) => {
|
28
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
|
+
]
|
29
66
|
|
30
67
|
const onIconClicked = (action) => {
|
31
68
|
switch (action) {
|
32
69
|
case 'add':
|
33
70
|
setShowModal(true)
|
34
71
|
break;
|
72
|
+
case 'config':
|
73
|
+
setShowConfigModal(true)
|
74
|
+
break;
|
35
75
|
default:
|
36
76
|
break;
|
37
77
|
}
|
@@ -69,7 +109,8 @@ const Folders = ({
|
|
69
109
|
closeModal={() => setShowModal(false)}
|
70
110
|
exitModalButton={(e) => (
|
71
111
|
<div></div>
|
72
|
-
)}
|
112
|
+
)}
|
113
|
+
>
|
73
114
|
<CreateFolder
|
74
115
|
saveBtnText="Create"
|
75
116
|
cancelBtnText="Cancel"
|
@@ -77,6 +118,43 @@ const Folders = ({
|
|
77
118
|
cancelHandler={cancelHandler}
|
78
119
|
/>
|
79
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>
|
80
158
|
</Container>
|
81
159
|
)
|
82
160
|
}
|
@@ -3,13 +3,18 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
4
4
|
|
5
5
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
6
|
+
import { BsGear } from "react-icons/bs";
|
6
7
|
import List from '../../Reusable Components/ReusableList/ReusableList';
|
7
8
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
9
|
import CreateFolder from '../CreateFolder/CreateFolder';
|
9
|
-
|
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';
|
10
14
|
|
11
15
|
const listControls = [
|
12
16
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
|
17
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
13
18
|
]
|
14
19
|
|
15
20
|
const cardControls = [
|
@@ -25,12 +30,44 @@ const Notes = ({
|
|
25
30
|
...props
|
26
31
|
}) => {
|
27
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
|
+
]
|
28
62
|
|
29
63
|
const onIconClicked = (action) => {
|
30
64
|
switch (action) {
|
31
65
|
case 'add':
|
32
66
|
setShowModal(true)
|
33
67
|
break;
|
68
|
+
case 'config':
|
69
|
+
setShowConfigModal(true)
|
70
|
+
break;
|
34
71
|
default:
|
35
72
|
break;
|
36
73
|
}
|
@@ -80,6 +117,25 @@ const Notes = ({
|
|
80
117
|
cancelHandler={cancelHandler}
|
81
118
|
/>
|
82
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>
|
83
139
|
</Container>
|
84
140
|
)
|
85
141
|
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
4
|
+
|
5
|
+
import NavbarPreview from '../../PreviewComponents/NavbarPreview/NavbarPreview';
|
6
|
+
import Button from '../../Buttons/Buttons/Buttons';
|
7
|
+
|
8
|
+
const SectionedPreview = () => {
|
9
|
+
const [showModal, setShowModal] = useState(false);
|
10
|
+
return (
|
11
|
+
<Container>
|
12
|
+
<Button
|
13
|
+
label={'Open Configurator'}
|
14
|
+
size="md"
|
15
|
+
variant="primary"
|
16
|
+
buttonClicked={() => { setShowModal(true) }}
|
17
|
+
/>
|
18
|
+
<Modal
|
19
|
+
modalIsOpen={showModal}
|
20
|
+
closeModal={() => setShowModal(false)}>
|
21
|
+
<NavbarPreview />
|
22
|
+
</Modal>
|
23
|
+
</Container>
|
24
|
+
);
|
25
|
+
};
|
26
|
+
|
27
|
+
const Container = styled.div`
|
28
|
+
|
29
|
+
`
|
30
|
+
|
31
|
+
export default SectionedPreview;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState } from 'react';
|
1
|
+
import React, { useState, useEffect } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import styled from 'styled-components';
|
4
4
|
|
@@ -6,10 +6,19 @@ import List from '../../Reusable Components/ReusableList/ReusableList';
|
|
6
6
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
7
7
|
|
8
8
|
import { AiOutlineFileAdd, AiOutlineDelete } from "react-icons/ai";
|
9
|
+
import { BsGear } from "react-icons/bs";
|
9
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'
|
10
18
|
|
11
19
|
const listControls = [
|
12
20
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
|
21
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
13
22
|
]
|
14
23
|
|
15
24
|
const cardControls = [
|
@@ -21,21 +30,55 @@ const ViewAlbum = ({
|
|
21
30
|
cardBackgroundColor,
|
22
31
|
songTitleColor,
|
23
32
|
...props }) => {
|
24
|
-
const [showModal, setShowModal] = useState(false)
|
33
|
+
const [showModal, setShowModal] = useState(false);
|
34
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
35
|
+
const [centerContext, setCenterContext] = useState(<ViewAlbum album={album}/>)
|
25
36
|
|
26
|
-
const
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
break;
|
37
|
+
const formChanged = (values) => {
|
38
|
+
console.log('context changed')
|
39
|
+
setCenterContext(<ViewAlbum album={album} {...values} />)
|
40
|
+
}
|
31
41
|
|
32
|
-
|
33
|
-
|
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
|
+
}
|
34
75
|
}
|
35
76
|
}
|
36
77
|
|
37
78
|
const cardIconClicked = (action, index) => {
|
38
|
-
props.
|
79
|
+
if (!props.preview) {
|
80
|
+
props.cardIconClicked(action, index)
|
81
|
+
}
|
39
82
|
}
|
40
83
|
|
41
84
|
const onAddSong = (song) => {
|
@@ -73,6 +116,76 @@ const ViewAlbum = ({
|
|
73
116
|
saveBtnText={props.saveBtnText || "Create"}
|
74
117
|
cancelBtnText={props.cancelBtnText || "Cancel"} />
|
75
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>
|
76
189
|
</Container>
|
77
190
|
)
|
78
191
|
}
|
@@ -82,7 +195,7 @@ const Container = styled.div`
|
|
82
195
|
`
|
83
196
|
|
84
197
|
ViewAlbum.defaultProps = {
|
85
|
-
|
198
|
+
|
86
199
|
};
|
87
200
|
|
88
201
|
ViewAlbum.propTypes = {
|
@@ -97,6 +210,7 @@ ViewAlbum.propTypes = {
|
|
97
210
|
cancelBtnText: PropTypes.string,
|
98
211
|
headerStyles: PropTypes.object,
|
99
212
|
customCardStyles: PropTypes.object,
|
213
|
+
preview: PropTypes.bool
|
100
214
|
};
|
101
215
|
|
102
216
|
export default ViewAlbum
|
@@ -5,11 +5,12 @@ import styled from 'styled-components';
|
|
5
5
|
import Gallery from '../../Reusable Components/Gallery/Gallery';
|
6
6
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
7
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';
|
8
11
|
|
9
12
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
import { BsGear } from "react-icons/bs";
|
13
14
|
|
14
15
|
const cardControls = [
|
15
16
|
{ icon: (<AiFillDelete />), action: 'delete', name: 'Delete album' },
|
@@ -17,6 +18,7 @@ const cardControls = [
|
|
17
18
|
|
18
19
|
const galleryControls = [
|
19
20
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
|
21
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
20
22
|
]
|
21
23
|
|
22
24
|
const ViewAlbums = ({
|
@@ -25,33 +27,40 @@ const ViewAlbums = ({
|
|
25
27
|
descColor,
|
26
28
|
...props
|
27
29
|
}) => {
|
28
|
-
const cardStyles = {
|
29
|
-
darkOnHover: true,
|
30
|
-
cardTitleColor: albumTitleColor,
|
31
|
-
descColor,
|
32
|
-
controlsStyles: {
|
33
|
-
showOnHover: true,
|
34
|
-
position: 'center',
|
35
|
-
iconBackground: "#272727",
|
36
|
-
dropdownBackground: "#272727",
|
37
|
-
dropdownFontColor: "white",
|
38
|
-
dropdownItemHoverColor: "#414141",
|
39
|
-
iconBackgroundHover: "#414141",
|
40
|
-
iconBorderRadius: 100,
|
41
|
-
iconSize: 25,
|
42
|
-
iconsGap: 10,
|
43
|
-
iconColor: 'white',
|
44
|
-
containerPadding: 20
|
45
|
-
}
|
46
|
-
}
|
47
30
|
|
48
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
|
+
]
|
49
55
|
|
50
56
|
const onHeaderIconClicked = (action) => {
|
51
57
|
switch (action) {
|
52
58
|
case 'add':
|
53
59
|
setShowModal(true)
|
54
60
|
break;
|
61
|
+
case 'config':
|
62
|
+
setShowConfigModal(true)
|
63
|
+
break;
|
55
64
|
default:
|
56
65
|
break;
|
57
66
|
}
|
@@ -74,7 +83,7 @@ const ViewAlbums = ({
|
|
74
83
|
return (
|
75
84
|
<Container>
|
76
85
|
<Gallery
|
77
|
-
galleryTitle={props.title || '
|
86
|
+
galleryTitle={props.title || 'Music Albums'}
|
78
87
|
data={albums}
|
79
88
|
type="flat"
|
80
89
|
cardStyle="card-style-6"
|
@@ -96,6 +105,28 @@ const ViewAlbums = ({
|
|
96
105
|
saveBtnText={props.saveBtnText || "Create"}
|
97
106
|
cancelBtnText={props.cancelBtnText || "Cancel"} />
|
98
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>
|
99
130
|
</Container>
|
100
131
|
)
|
101
132
|
}
|
@@ -103,9 +134,7 @@ const Container = styled.div`
|
|
103
134
|
width: 100%;
|
104
135
|
`
|
105
136
|
|
106
|
-
ViewAlbums.defaultProps = {
|
107
|
-
cardBackgroundColor: 'white'
|
108
|
-
};
|
137
|
+
ViewAlbums.defaultProps = {};
|
109
138
|
|
110
139
|
ViewAlbums.propTypes = {
|
111
140
|
albums: PropTypes.array,
|
@@ -117,6 +146,7 @@ ViewAlbums.propTypes = {
|
|
117
146
|
title: PropTypes.string,
|
118
147
|
saveBtnText: PropTypes.string,
|
119
148
|
cancelBtnText: PropTypes.string,
|
149
|
+
preview: PropTypes.bool
|
120
150
|
};
|
121
151
|
|
122
152
|
export default ViewAlbums
|
@@ -11,7 +11,6 @@ import BaseMaterial from '../../../Containers/BaseMaterial';
|
|
11
11
|
import SpaceContainer from "../../../Reusable Components/SpaceContainer/SpaceContainer";
|
12
12
|
import WidgetContainer from "../../../Reusable Components/WidgetContainer/WidgetContainer";
|
13
13
|
import DetailedEvent from '../../../Events/Event/Event';
|
14
|
-
import { addObjectToArray, deleteFromArrayByIndex } from '../../../helpers/util';
|
15
14
|
|
16
15
|
import worldStyles from '../../ViewWorld/styles.json';
|
17
16
|
|
@@ -30,16 +29,25 @@ const Event = (props) => {
|
|
30
29
|
}}
|
31
30
|
/>
|
32
31
|
<WidgetContainer
|
33
|
-
widgetType='list'
|
32
|
+
widgetType='spaces-list'
|
34
33
|
widgetProps={{
|
35
34
|
listTitle: 'Your Spaces',
|
36
35
|
type: 'sectioned',
|
37
|
-
|
36
|
+
spaces: SPACES,
|
38
37
|
cardStyle: 'card-style-3',
|
38
|
+
cardClicked: () => alert('clicked'),
|
39
|
+
headerStyles:{
|
40
|
+
headerBackground: 'purple',
|
41
|
+
padding: 3,
|
42
|
+
controlsStyles:{
|
43
|
+
iconColor: 'white',
|
44
|
+
iconsGap: 5
|
45
|
+
}
|
46
|
+
},
|
39
47
|
sectionHeaderStyles: {
|
40
48
|
cardBorderSize: 2,
|
41
49
|
cardPadding: 2,
|
42
|
-
|
50
|
+
headerBackground: 'red',
|
43
51
|
cardBorderColor: 'black',
|
44
52
|
},
|
45
53
|
customCardStyles: {
|