@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
@@ -4,7 +4,6 @@ import PropTypes from "prop-types";
|
|
4
4
|
|
5
5
|
import { getCardStyle } from '../../helpers/util';
|
6
6
|
|
7
|
-
import CardStyle3 from '../Cards/Card-style-3/CardStyle3';
|
8
7
|
import ReusableHeader from '../ReusableHeader/ReusableHeader';
|
9
8
|
|
10
9
|
const ReusableList = ({
|
@@ -20,15 +19,21 @@ const ReusableList = ({
|
|
20
19
|
let child;
|
21
20
|
|
22
21
|
const iconCliked = (action) => {
|
23
|
-
props.iconClicked
|
22
|
+
if (props.iconClicked) {
|
23
|
+
props.iconClicked(action)
|
24
|
+
}
|
24
25
|
}
|
25
26
|
|
26
27
|
const clicked = (index, cardProps) => {
|
27
|
-
props.cardClicked
|
28
|
+
if (props.cardClicked) {
|
29
|
+
props.cardClicked(index, cardProps)
|
30
|
+
}
|
28
31
|
}
|
29
32
|
|
30
33
|
const cardIconClicked = (action, index) => {
|
31
|
-
props.cardIconClicked
|
34
|
+
if (props.cardIconClicked) {
|
35
|
+
props.cardIconClicked(action, index)
|
36
|
+
}
|
32
37
|
}
|
33
38
|
|
34
39
|
const mapOverCardsData = (data) => {
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import styled from 'styled-components';
|
4
|
+
|
5
|
+
import ReusableHeader from '../ReusableHeader/ReusableHeader';
|
6
|
+
import { useState } from 'react';
|
7
|
+
|
8
|
+
const Tabs = ({ title, tabs, ...props }) => {
|
9
|
+
const [child, setChild] = useState(props.children[0])
|
10
|
+
|
11
|
+
const tabClicked = (tab) => {
|
12
|
+
let renderedComponent = props.children.find(child => child.props.id === tab.id)
|
13
|
+
setChild(renderedComponent)
|
14
|
+
}
|
15
|
+
|
16
|
+
return (
|
17
|
+
<Container>
|
18
|
+
<ReusableHeader
|
19
|
+
title={title}
|
20
|
+
{...props.headerStyles} />
|
21
|
+
<TabsContainer>
|
22
|
+
<Menu>
|
23
|
+
{tabs.map(tab => <Tab onClick={() => tabClicked(tab)}>{tab.title}</Tab>)}
|
24
|
+
</Menu>
|
25
|
+
{child}
|
26
|
+
</TabsContainer>
|
27
|
+
</Container>
|
28
|
+
);
|
29
|
+
};
|
30
|
+
|
31
|
+
const Container = styled.div`
|
32
|
+
font-family: sans-serif;
|
33
|
+
`
|
34
|
+
|
35
|
+
const TabsContainer = styled.div`
|
36
|
+
|
37
|
+
`
|
38
|
+
|
39
|
+
const Menu = styled.div`
|
40
|
+
display: flex;
|
41
|
+
justify-content: center;
|
42
|
+
gap: 10px;
|
43
|
+
background-color: white;
|
44
|
+
`
|
45
|
+
|
46
|
+
const Tab = styled.div`
|
47
|
+
padding: 5px 8px;
|
48
|
+
cursor: pointer;
|
49
|
+
background-color: white;
|
50
|
+
border: 1px solid gray;
|
51
|
+
color: #414141;
|
52
|
+
transition: all .3s;
|
53
|
+
&:hover {
|
54
|
+
background-color: #414141;
|
55
|
+
color: white;
|
56
|
+
}
|
57
|
+
`
|
58
|
+
|
59
|
+
Tabs.defaultProps = {};
|
60
|
+
|
61
|
+
Tabs.propTypes = {
|
62
|
+
title: PropTypes.string,
|
63
|
+
tabs: PropTypes.array,
|
64
|
+
headerStyles: PropTypes.object
|
65
|
+
}
|
66
|
+
|
67
|
+
export default Tabs;
|
@@ -7,10 +7,13 @@ import ReusableList from '../Reusable Components/ReusableList/ReusableList';
|
|
7
7
|
|
8
8
|
|
9
9
|
const Sections = ({sections, ...props}) => {
|
10
|
-
const [center, setCenter] = useState(
|
10
|
+
const [center, setCenter] = useState(props.children[0] || props.children)
|
11
|
+
console.log('renders')
|
11
12
|
|
12
13
|
const cardClicked = (index, cardProps) => {
|
13
|
-
|
14
|
+
let child = props.children.find(child => child.props.id === cardProps.id)
|
15
|
+
setCenter(child)
|
16
|
+
console.log(child)
|
14
17
|
}
|
15
18
|
|
16
19
|
return (
|
@@ -5,8 +5,14 @@ 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 CreateVideoAlbum from '../../Forms/CreateVideoAlbum/CreateVideoAlbum';
|
8
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
9
|
+
import Sections from '../../Sections/Sections'
|
10
|
+
import VideoAlbumsPreview from '../../PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview';
|
11
|
+
import Community from '../../Reusable Components/Community/Community';
|
12
|
+
|
8
13
|
|
9
14
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
15
|
+
import { BsGear } from "react-icons/bs";
|
10
16
|
|
11
17
|
const cardControls = [
|
12
18
|
{ icon: (<AiFillDelete />), action: 'delete', name: 'Delete album' },
|
@@ -14,6 +20,7 @@ const cardControls = [
|
|
14
20
|
|
15
21
|
const galleryControls = [
|
16
22
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
|
23
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
17
24
|
]
|
18
25
|
|
19
26
|
const AlbumsGallery = ({
|
@@ -24,7 +31,23 @@ const AlbumsGallery = ({
|
|
24
31
|
countColor,
|
25
32
|
countFontSize,
|
26
33
|
...props }) => {
|
27
|
-
const [showModal, setShowModal] = useState(false)
|
34
|
+
const [showModal, setShowModal] = useState(false);
|
35
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
36
|
+
const [centerContext, setCenterContext] = useState(<AlbumsGallery videoAlbums={videoAlbums} />)
|
37
|
+
|
38
|
+
const formChanged = (values) => {
|
39
|
+
setCenterContext(<AlbumsGallery videoAlbums={videoAlbums} {...values} />)
|
40
|
+
}
|
41
|
+
|
42
|
+
let tabs = [
|
43
|
+
{
|
44
|
+
title: 'New', id: 'preview'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
title: 'Context', id: 'community'
|
48
|
+
}
|
49
|
+
]
|
50
|
+
|
28
51
|
|
29
52
|
const cardStyles = {
|
30
53
|
cardBackgroundColor,
|
@@ -51,12 +74,17 @@ const AlbumsGallery = ({
|
|
51
74
|
}
|
52
75
|
|
53
76
|
const onIconClicked = (action) => {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
77
|
+
if (!props.preview) {
|
78
|
+
switch (action) {
|
79
|
+
case 'add':
|
80
|
+
setShowModal(true)
|
81
|
+
break;
|
82
|
+
case 'config':
|
83
|
+
setShowConfigModal(true)
|
84
|
+
break;
|
85
|
+
default:
|
86
|
+
break;
|
87
|
+
}
|
60
88
|
}
|
61
89
|
}
|
62
90
|
|
@@ -81,14 +109,6 @@ const AlbumsGallery = ({
|
|
81
109
|
type="flat"
|
82
110
|
cardStyle="card-style-6"
|
83
111
|
columnsNumber={3}
|
84
|
-
headerStyles={{
|
85
|
-
padding: 10,
|
86
|
-
headerBackground: '#FE1744',
|
87
|
-
titleColor: '#ffff',
|
88
|
-
controlsStyles: {
|
89
|
-
iconSize: 25
|
90
|
-
}
|
91
|
-
}}
|
92
112
|
iconClicked={onIconClicked}
|
93
113
|
galleryColumnGap={10}
|
94
114
|
galleryRowGap={20}
|
@@ -97,6 +117,7 @@ const AlbumsGallery = ({
|
|
97
117
|
cardClicked={() => null}
|
98
118
|
cardIconClicked={cardIconClicked}
|
99
119
|
customCardStyles={cardStyles}
|
120
|
+
{...props}
|
100
121
|
/>
|
101
122
|
<Modal
|
102
123
|
modalIsOpen={showModal}
|
@@ -108,7 +129,27 @@ const AlbumsGallery = ({
|
|
108
129
|
saveHandler={onAddAlbum}
|
109
130
|
cancelHandler={cancelHandler} />
|
110
131
|
</Modal>
|
111
|
-
|
132
|
+
<Modal
|
133
|
+
modalIsOpen={showConfigModal}
|
134
|
+
closeModal={() => setShowConfigModal(false)}
|
135
|
+
exitModalButton={(e) => (
|
136
|
+
<div></div>
|
137
|
+
)}>
|
138
|
+
<Tabs
|
139
|
+
title="Video Gallery Config"
|
140
|
+
tabs={tabs}
|
141
|
+
id='styling'
|
142
|
+
>
|
143
|
+
<VideoAlbumsPreview
|
144
|
+
componentProps={{ videoAlbums, preview: true }}
|
145
|
+
formChanged={formChanged}
|
146
|
+
id="preview" />
|
147
|
+
<Community
|
148
|
+
center={centerContext}
|
149
|
+
id="community" />
|
150
|
+
</Tabs>
|
151
|
+
</Modal>
|
152
|
+
</Container >
|
112
153
|
)
|
113
154
|
}
|
114
155
|
|
@@ -1,10 +1,23 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { useState } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import styled from 'styled-components';
|
4
4
|
|
5
|
+
import Modal from '../../Reusable Components/ReactModal/ReactModal'
|
5
6
|
import VideoPlayer from '../VideoPlayer/VideoPlayer';
|
6
7
|
import Comments from '../Comments/Comments';
|
7
8
|
import RichTextInput from '../../Common Inputs/RichTextInput/RichTextInput';
|
9
|
+
import ReusableHeader from '../../Reusable Components/ReusableHeader/ReusableHeader';
|
10
|
+
import { BsGear } from "react-icons/bs";
|
11
|
+
import VideoPreview from '../../PreviewComponents/VideoPreview/VideoPreview';
|
12
|
+
import Community from '../../Reusable Components/Community/Community';
|
13
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
const controls = [
|
19
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
20
|
+
]
|
8
21
|
|
9
22
|
const VideoSpace = ({
|
10
23
|
videoSrc,
|
@@ -26,9 +39,43 @@ const VideoSpace = ({
|
|
26
39
|
commentTitleColor,
|
27
40
|
commentTitleFontSize,
|
28
41
|
...props }) => {
|
42
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
43
|
+
const [centerContext, setCenterContext] = useState(<VideoSpace videoSrc={videoSrc} />)
|
44
|
+
|
45
|
+
const formChanged = (values) => {
|
46
|
+
setCenterContext(<VideoSpace videoSrc={videoSrc} {...values} />)
|
47
|
+
}
|
48
|
+
|
49
|
+
let tabs = [
|
50
|
+
{
|
51
|
+
title: 'New', id: 'preview'
|
52
|
+
},
|
53
|
+
{
|
54
|
+
title: 'Context', id: 'community'
|
55
|
+
}
|
56
|
+
]
|
57
|
+
|
58
|
+
|
59
|
+
const iconClicked = (action) => {
|
60
|
+
if (!props.preview) {
|
61
|
+
switch (action) {
|
62
|
+
case 'config':
|
63
|
+
setShowConfigModal(true)
|
64
|
+
break;
|
65
|
+
default:
|
66
|
+
break;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
29
70
|
|
30
71
|
return (
|
31
72
|
<Container backgroundColor={backgroundColor}>
|
73
|
+
<ReusableHeader
|
74
|
+
title={title || 'Video Space'}
|
75
|
+
controls={controls}
|
76
|
+
iconClicked={iconClicked}
|
77
|
+
{...props.headerStyles}
|
78
|
+
/>
|
32
79
|
<VideoPlayer
|
33
80
|
iconsColor={iconsColor}
|
34
81
|
src={videoSrc} />
|
@@ -47,6 +94,28 @@ const VideoSpace = ({
|
|
47
94
|
<RichTextInput
|
48
95
|
users={users}
|
49
96
|
/>
|
97
|
+
<Modal
|
98
|
+
modalIsOpen={showConfigModal}
|
99
|
+
closeModal={() => setShowConfigModal(false)}
|
100
|
+
exitModalButton={(e) => (
|
101
|
+
<div></div>
|
102
|
+
)}
|
103
|
+
>
|
104
|
+
<Tabs
|
105
|
+
title="Video Space Config"
|
106
|
+
tabs={tabs}
|
107
|
+
id='styling'
|
108
|
+
>
|
109
|
+
<VideoPreview
|
110
|
+
componentProps={{ title, discription, comments, date, preview: true }}
|
111
|
+
formChanged={formChanged}
|
112
|
+
id="preview" />
|
113
|
+
|
114
|
+
<Community
|
115
|
+
center={centerContext}
|
116
|
+
id="community" />
|
117
|
+
</Tabs>
|
118
|
+
</Modal>
|
50
119
|
</Container>
|
51
120
|
)
|
52
121
|
}
|
@@ -5,18 +5,24 @@ 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 AddVideo from '../../Forms/AddVideo/AddVideo';
|
8
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
9
|
+
import Sections from '../../Sections/Sections'
|
10
|
+
import VideoAlbumPreview from '../../PreviewComponents/VideoAlbumPreview/VideoAlbumPreview';
|
11
|
+
import Community from '../../Reusable Components/Community/Community';
|
8
12
|
|
9
|
-
import { AiFillPlayCircle, AiFillDelete, AiOutlineFileAdd } from "react-icons/ai";
|
10
13
|
|
11
14
|
|
15
|
+
import { AiFillPlayCircle, AiFillDelete, AiOutlineFileAdd } from "react-icons/ai";
|
16
|
+
import { BsGear } from "react-icons/bs";
|
12
17
|
|
13
18
|
const cardControls = [
|
14
19
|
{ icon: (<AiFillPlayCircle />), action: 'play', name: 'play video' },
|
15
|
-
{icon: (<AiFillDelete />), action: 'delete', name: 'Delete video'}
|
20
|
+
{ icon: (<AiFillDelete />), action: 'delete', name: 'Delete video' }
|
16
21
|
]
|
17
22
|
|
18
23
|
const galleryControls = [
|
19
24
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
|
25
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
20
26
|
]
|
21
27
|
|
22
28
|
const ViewAlbum = ({
|
@@ -25,8 +31,38 @@ const ViewAlbum = ({
|
|
25
31
|
cardTitleColor,
|
26
32
|
cardTitleFontSize,
|
27
33
|
descColor,
|
28
|
-
|
34
|
+
...props }) => {
|
29
35
|
const [showModal, setShowModal] = useState(false);
|
36
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
37
|
+
const [centerContext, setCenterContext] = useState(<ViewAlbum album={album}/>)
|
38
|
+
|
39
|
+
const formChanged = (values) => {
|
40
|
+
console.log('context changed')
|
41
|
+
setCenterContext(<ViewAlbum album={album} {...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="Video Album Config"
|
60
|
+
tabs={tabs}
|
61
|
+
/>)
|
62
|
+
}
|
63
|
+
]
|
64
|
+
}
|
65
|
+
]
|
30
66
|
|
31
67
|
const cardStyles = {
|
32
68
|
darkOnHover: true,
|
@@ -53,6 +89,9 @@ const ViewAlbum = ({
|
|
53
89
|
case 'add':
|
54
90
|
setShowModal(true)
|
55
91
|
break;
|
92
|
+
case 'config':
|
93
|
+
setShowConfigModal(true)
|
94
|
+
break;
|
56
95
|
default:
|
57
96
|
break;
|
58
97
|
}
|
@@ -96,6 +135,26 @@ const ViewAlbum = ({
|
|
96
135
|
saveHandler={onAddVideo}
|
97
136
|
cancelHandler={cancelHandler} />
|
98
137
|
</Modal>
|
138
|
+
<Modal
|
139
|
+
modalIsOpen={showConfigModal}
|
140
|
+
closeModal={() => setShowConfigModal(false)}
|
141
|
+
exitModalButton={(e) => (
|
142
|
+
<div></div>
|
143
|
+
)}>
|
144
|
+
<Tabs
|
145
|
+
title="Video Album Config"
|
146
|
+
tabs={tabs}
|
147
|
+
id='styling'
|
148
|
+
>
|
149
|
+
<VideoAlbumPreview
|
150
|
+
componentProps={{ album, preview: true }}
|
151
|
+
formChanged={formChanged}
|
152
|
+
id="preview" />
|
153
|
+
<Community
|
154
|
+
center={centerContext}
|
155
|
+
id="community" />
|
156
|
+
</Tabs>
|
157
|
+
</Modal>
|
99
158
|
</Container>
|
100
159
|
)
|
101
160
|
}
|
@@ -5,10 +5,9 @@ import styled from 'styled-components';
|
|
5
5
|
import AudioPlayer from 'react-h5-audio-player';
|
6
6
|
import 'react-h5-audio-player/lib/styles.css';
|
7
7
|
|
8
|
+
import ReusableHeader from '../../Reusable Components/ReusableHeader/ReusableHeader';
|
8
9
|
|
9
|
-
|
10
|
-
const MusicPlayerWidget = ({currentSong , ...props}) => {
|
11
|
-
|
10
|
+
const MusicPlayerWidget = ({ currentSong, ...props }) => {
|
12
11
|
|
13
12
|
const musicPlayerHeading = (
|
14
13
|
<Header>
|
@@ -23,9 +22,12 @@ const MusicPlayerWidget = ({currentSong , ...props}) => {
|
|
23
22
|
</Header>
|
24
23
|
)
|
25
24
|
|
26
|
-
|
27
|
-
|
28
25
|
return (
|
26
|
+
<Container>
|
27
|
+
<ReusableHeader
|
28
|
+
title={props.title || 'Music Player'}
|
29
|
+
{...props.headerStyles}
|
30
|
+
/>
|
29
31
|
<MusicPlayer
|
30
32
|
autoPlay='none'
|
31
33
|
src={props.playlist[currentSong].musicSrc}
|
@@ -37,13 +39,17 @@ const MusicPlayerWidget = ({currentSong , ...props}) => {
|
|
37
39
|
onClickNext={() => props.nextSong()}
|
38
40
|
{...props}
|
39
41
|
/>
|
42
|
+
</Container>
|
40
43
|
)
|
41
44
|
}
|
42
45
|
|
46
|
+
const Container = styled.div`
|
47
|
+
width: 100%;
|
48
|
+
`
|
43
49
|
|
44
50
|
const MusicPlayer = styled(AudioPlayer)`
|
45
51
|
|
46
|
-
font-family: ${props => props.fontFamily || '
|
52
|
+
font-family: ${props => props.fontFamily || 'sans-serif'};
|
47
53
|
background-color: ${props => props.backgroundColor || 'transparent'};
|
48
54
|
border-radius: ${props => props.borderRadius ? props.borderRadius + 'px' : 'inherit'};
|
49
55
|
padding: ${props => props.padding ? props.padding + 'px' : 'inherit'}px;
|
@@ -96,6 +102,7 @@ const Img = styled.img`
|
|
96
102
|
const MusicName = styled.h3`
|
97
103
|
color: ${props => props.fontColor};
|
98
104
|
font-size: ${props => props.fontSize}px;
|
105
|
+
font-weight: 300;
|
99
106
|
`
|
100
107
|
|
101
108
|
const ArtistName = styled.p`
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import List from '../../Reusable Components/ReusableList/ReusableList';
|
4
|
+
|
5
|
+
import { AiOutlineFileAdd } from "react-icons/ai";
|
6
|
+
import { BsGear } from "react-icons/bs";
|
7
|
+
|
8
|
+
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
9
|
+
import SpaceListPreview from '../../PreviewComponents/SpacesListPreview/SpacesListPreview';
|
10
|
+
import CreateSpace from '../../Forms/CreateSpace/CreateSpace';
|
11
|
+
|
12
|
+
const SpacesListWidget = ({
|
13
|
+
spaces,
|
14
|
+
...props
|
15
|
+
}) => {
|
16
|
+
const [showCreateModal, setShowCreateModal] = useState(false)
|
17
|
+
const [showConfigModal, setShowConfigModal] = useState(false)
|
18
|
+
|
19
|
+
const listControls = [
|
20
|
+
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Create Space' },
|
21
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
22
|
+
]
|
23
|
+
|
24
|
+
const onIconClicked = (action) => {
|
25
|
+
if (!props.preview) {
|
26
|
+
switch (action) {
|
27
|
+
case 'add':
|
28
|
+
setShowCreateModal(true)
|
29
|
+
break;
|
30
|
+
case 'config':
|
31
|
+
setShowConfigModal(true)
|
32
|
+
break;
|
33
|
+
default:
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
return (
|
40
|
+
<Container>
|
41
|
+
<List
|
42
|
+
listTitle={props.title || 'My Spaces'}
|
43
|
+
type='sectioned'
|
44
|
+
data={spaces}
|
45
|
+
iconClicked={onIconClicked}
|
46
|
+
listControls={listControls}
|
47
|
+
cardStyle='card-style-3'
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<Modal
|
51
|
+
modalIsOpen={showCreateModal}
|
52
|
+
closeModal={() => setShowCreateModal(false)}
|
53
|
+
exitModalButton={(e) => (
|
54
|
+
<div></div>
|
55
|
+
)}
|
56
|
+
>
|
57
|
+
<CreateSpace />
|
58
|
+
</Modal>
|
59
|
+
<Modal
|
60
|
+
modalIsOpen={showConfigModal}
|
61
|
+
closeModal={() => setShowConfigModal(false)}
|
62
|
+
exitModalButton={(e) => (
|
63
|
+
<div></div>
|
64
|
+
)}
|
65
|
+
>
|
66
|
+
<SpaceListPreview
|
67
|
+
componentProps={{ spaces, preview: true }}
|
68
|
+
/>
|
69
|
+
</Modal>
|
70
|
+
</Container>
|
71
|
+
);
|
72
|
+
};
|
73
|
+
|
74
|
+
const Container = styled.div`
|
75
|
+
|
76
|
+
`
|
77
|
+
|
78
|
+
export default SpacesListWidget;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import List from '../../Reusable Components/ReusableList/ReusableList';
|
3
|
+
|
4
|
+
const UsersWidget = ({
|
5
|
+
users,
|
6
|
+
...props
|
7
|
+
}) => {
|
8
|
+
|
9
|
+
return (
|
10
|
+
<List
|
11
|
+
listTitle={props.title || 'Members List'}
|
12
|
+
cardStyle="card-style-1"
|
13
|
+
data={users}
|
14
|
+
type="flat"
|
15
|
+
{...props}
|
16
|
+
/>
|
17
|
+
);
|
18
|
+
};
|
19
|
+
|
20
|
+
export default UsersWidget;
|
@@ -16,13 +16,22 @@ import MusicPlayerWidget from '../Widgets/MusicPlayerWidget/MusicPlayerWidget';
|
|
16
16
|
import LogoWidget from '../Widgets/LogoWidget/LogoWidget';
|
17
17
|
import VideoPlayer from '../VideoAlbum/VideoPlayer/VideoPlayer';
|
18
18
|
import Notes from '../Library/Notes/Notes';
|
19
|
-
import Folders from '../Library/Folders/Folders'
|
20
|
-
|
19
|
+
import Folders from '../Library/Folders/Folders';
|
20
|
+
import UsersWidget from '../Widgets/UsersWidget/UsersWidget';
|
21
|
+
import SpacesListWidget from '../Widgets/SpacesListWidget/SpacesListWidget';
|
22
|
+
// Preview Components
|
21
23
|
import Navbar from '../Navbar/Navbar';
|
22
24
|
import MusicAlbums from '../Music Album/ViewAlbums/ViewAlbums';
|
23
25
|
import MusicAlbum from '../Music Album/ViewAlbum/ViewAlbum';
|
24
26
|
import PhotoAlbums from '../Photo Album/ViewAlbums/ViewAlbums'
|
25
27
|
import PhotoAlbum from '../Photo Album/ViewAlbum/ViewAlbum';
|
28
|
+
import MusicPlayer from '../Widgets/MusicPlayerWidget/MusicPlayerWidget';
|
29
|
+
import Chat from '../Chat/Chat';
|
30
|
+
import Events from '../Events/EventsList/EventsList';
|
31
|
+
import Event from '../Events/Event/Event';
|
32
|
+
import VideoSpace from '../VideoAlbum/VideoSpace/VideoSpace';
|
33
|
+
import VideoAlbums from '../VideoAlbum/AlbumsGallery/AlbumsGallery';
|
34
|
+
import VideoAlbum from '../VideoAlbum/ViewAlbum/ViewAlbum';
|
26
35
|
|
27
36
|
export const stringSearch = (str, word) => {
|
28
37
|
str = str.toUpperCase();
|
@@ -72,6 +81,9 @@ export const getWidgetType = (widgetType, props, cardClicked) => {
|
|
72
81
|
'video player': (<VideoPlayer {...props}/>),
|
73
82
|
'notes': (<Notes {...props}/>),
|
74
83
|
'folders': (<Folders {...props}/>),
|
84
|
+
'users': (<UsersWidget {...props}/>),
|
85
|
+
'profile': (<CardStyle2 {...props}/>),
|
86
|
+
'spaces-list': (<SpacesListWidget cardClicked={(path) => cardClicked(path)} {...props}/>),
|
75
87
|
}
|
76
88
|
return widgetTypes[widgetType]
|
77
89
|
}
|
@@ -83,6 +95,16 @@ export const getComponentType = (componentType, componentProps, stylingProps) =
|
|
83
95
|
'MusicAlbum': (<MusicAlbum {...componentProps} {...stylingProps}/>),
|
84
96
|
'PhotoAlbum': (<PhotoAlbum {...componentProps} {...stylingProps}/>),
|
85
97
|
'PhotoAlbums': (<PhotoAlbums {...componentProps}{...stylingProps}/>),
|
98
|
+
'MusicPlayer': (<MusicPlayer {...componentProps}{...stylingProps}/>),
|
99
|
+
'Folders': (<Folders {...componentProps}{...stylingProps}/>),
|
100
|
+
'Notes': (<Notes {...componentProps}{...stylingProps}/>),
|
101
|
+
'Spaces-List': (<SpacesListWidget {...componentProps}{...stylingProps}/>),
|
102
|
+
'Chat': (<Chat {...componentProps}{...stylingProps}/>),
|
103
|
+
'Events': (<Events {...componentProps}{...stylingProps}/>),
|
104
|
+
'Event': (<Event {...componentProps}{...stylingProps}/>),
|
105
|
+
'Video-Space': (<VideoSpace {...componentProps}{...stylingProps}/>),
|
106
|
+
'Video-Albums': (<VideoAlbums {...componentProps}{...stylingProps}/>),
|
107
|
+
'Video-Album': (<VideoAlbum {...componentProps}{...stylingProps}/>),
|
86
108
|
}
|
87
109
|
return componentTypes[componentType]
|
88
110
|
}
|