@mohamed-karawia/library 0.1.18 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/stories/Chat/Chat.js +114 -4
- 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 +159 -0
- package/dist/stories/Events/Event/Event.js +123 -4
- package/dist/stories/Events/EventsList/EventsList.js +98 -16
- package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
- package/dist/stories/Library/Folders/Folders.js +94 -9
- package/dist/stories/Library/Notes/Notes.js +94 -9
- package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
- package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +98 -10
- package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +96 -34
- 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 +94 -17
- package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +88 -10
- 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 +53 -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 +85 -19
- package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +108 -4
- package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +84 -9
- 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 +941 -0
- package/dist/stories/store/store.js +44 -0
- package/package.json +5 -2
- package/src/stories/Chat/Chat.jsx +110 -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 +109 -0
- package/src/stories/Events/Event/Event.jsx +105 -4
- package/src/stories/Events/EventsList/EventsList.jsx +98 -17
- package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
- package/src/stories/Library/Folders/Folders.jsx +94 -7
- package/src/stories/Library/Notes/Notes.jsx +73 -7
- package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
- package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +81 -11
- package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +78 -34
- 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 +68 -6
- package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +69 -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 +47 -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 +64 -16
- package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +77 -1
- package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +64 -9
- 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 +703 -0
- package/src/stories/store/store.js +33 -0
- package/src/stories/styling.json +92 -0
@@ -24,7 +24,7 @@ export const globalContent = styled.div`
|
|
24
24
|
display: flex;
|
25
25
|
flex-direction: column;
|
26
26
|
flex-grow: 1;
|
27
|
-
gap: ${props => props.contentGap}px;
|
27
|
+
gap: ${props => props.contentGap || 10}px;
|
28
28
|
`
|
29
29
|
|
30
30
|
export const Title = styled.h3`
|
@@ -32,6 +32,7 @@ export const Title = styled.h3`
|
|
32
32
|
color: ${props => props.cardTitleColor || 'black'};
|
33
33
|
font-size: ${props => props.cardTitleFontSize}px;
|
34
34
|
font-weight: ${props => props.cardTitleFontWeight || 300};
|
35
|
+
cursor: pointer;
|
35
36
|
`
|
36
37
|
|
37
38
|
export const Description = styled.h5`
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import styled from 'styled-components'
|
4
|
+
|
5
|
+
// import Head from '../../Layout/Head/Head'
|
6
|
+
import Navbar from '../../Navbar/Navbar'
|
7
|
+
import Body from '../../Layout/Body/Body'
|
8
|
+
import Left from '../../Layout/Left/Left'
|
9
|
+
import Center from '../../Layout/Center/Center'
|
10
|
+
import Right from '../../Layout/Right/Right'
|
11
|
+
import WidgetContainer from "../../Reusable Components/WidgetContainer/WidgetContainer";
|
12
|
+
import BaseMaterial from '../../Containers/BaseMaterial'
|
13
|
+
// import styles from '../../styling.json'
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
const Community = ({
|
18
|
+
context,
|
19
|
+
community,
|
20
|
+
...props
|
21
|
+
}) => {
|
22
|
+
|
23
|
+
const spacesWidget = community.spacesListWidget.widgetSpacesList
|
24
|
+
|
25
|
+
return (
|
26
|
+
<BaseMaterial {...community.styles}>
|
27
|
+
<Navbar {...community.navbarStyles} />
|
28
|
+
<Body>
|
29
|
+
<Left>
|
30
|
+
<WidgetContainer
|
31
|
+
widgetType='spaces-list'
|
32
|
+
widgetProps={{
|
33
|
+
listTitle: spacesWidget.listTitle,
|
34
|
+
spaces: spacesWidget.spaces,
|
35
|
+
cardClicked: () => null,
|
36
|
+
...spacesWidget.styles
|
37
|
+
}}
|
38
|
+
/>
|
39
|
+
</Left>
|
40
|
+
<Center>{props.center}</Center>
|
41
|
+
<Right>{props.right}</Right>
|
42
|
+
</Body>
|
43
|
+
</BaseMaterial>
|
44
|
+
);
|
45
|
+
};
|
46
|
+
|
47
|
+
export default Community;
|
@@ -11,15 +11,21 @@ const Gallery = ({ data, cardStyle, customCardStyles, type, cardControls = null,
|
|
11
11
|
let child;
|
12
12
|
|
13
13
|
const iconCliked = (action) => {
|
14
|
-
props.
|
14
|
+
if (!props.preview) {
|
15
|
+
props.iconClicked(action)
|
16
|
+
}
|
15
17
|
}
|
16
18
|
|
17
19
|
const clicked = (index, cardProps) => {
|
20
|
+
if (!props.preview) {
|
18
21
|
props.cardClicked(index, cardProps)
|
22
|
+
}
|
19
23
|
}
|
20
24
|
|
21
25
|
const cardIconClicked = (action, index) => {
|
26
|
+
if (!props.preview) {
|
22
27
|
props.cardIconClicked(action, index)
|
28
|
+
}
|
23
29
|
}
|
24
30
|
|
25
31
|
const mapOverCardsData = (data) => {
|
@@ -69,8 +75,7 @@ const GalleryBody = styled.div`
|
|
69
75
|
display: ${({ type }) => type === 'flat' ? 'grid' : 'flex'};
|
70
76
|
flex-direction: column;
|
71
77
|
grid-template-columns: ${props => 'repeat(' + props.columnsNumber + ', 1fr)'};
|
72
|
-
grid-auto-rows: ${props => props.rowsHeight
|
73
|
-
/* grid-auto-rows: ${props => props.rowsHeight + 'px' || 'minmax(min-content, 400px)'}; */
|
78
|
+
grid-auto-rows: ${props => props.rowsHeight ? `${props.rowsHeight}px` : '1fr'};
|
74
79
|
column-gap: ${props => props.galleryColumnGap}px;
|
75
80
|
row-gap: ${props => props.galleryRowGap}px;
|
76
81
|
`
|
@@ -83,12 +88,8 @@ const Section = styled.div`
|
|
83
88
|
row-gap: ${props => props.galleryRowGap}px;
|
84
89
|
`
|
85
90
|
|
86
|
-
const SectionBody = styled
|
87
|
-
padding: ${props => props.galleryBodyPadding}px;
|
91
|
+
const SectionBody = styled(GalleryBody)`
|
88
92
|
display: grid;
|
89
|
-
grid-template-columns: ${props => 'repeat(' + props.columnsNumber + ', 1fr)'};
|
90
|
-
column-gap: ${props => props.galleryColumnGap}px;
|
91
|
-
row-gap: ${props => props.galleryRowGap}px;
|
92
93
|
`
|
93
94
|
|
94
95
|
Gallery.defaultProps = {
|
@@ -108,7 +109,7 @@ Gallery.propTypes = {
|
|
108
109
|
galleryColumnGap: PropTypes.number,
|
109
110
|
galleryRowGap: PropTypes.number,
|
110
111
|
rowsHeight: PropTypes.number
|
111
|
-
|
112
|
+
|
112
113
|
};
|
113
114
|
|
114
115
|
export default Gallery
|
@@ -17,42 +17,22 @@ const ReactModalComponent = ({
|
|
17
17
|
closeModal,
|
18
18
|
children,
|
19
19
|
exitModalButton,
|
20
|
-
|
20
|
+
shouldCloseOnOverlayClick
|
21
21
|
}) => {
|
22
22
|
return (
|
23
|
-
<
|
23
|
+
<Modal
|
24
24
|
isOpen={modalIsOpen}
|
25
25
|
onRequestClose={closeModal}
|
26
|
-
ariaHideApp={false}
|
27
|
-
contentLabel={title}
|
28
|
-
shouldCloseOnOverlayClick={onOverlayCloseClick === 'true'}
|
29
|
-
borderColor={borderColor}
|
30
|
-
boxShadow={boxShadow}
|
31
|
-
backgroundColor={backgroundColor}
|
32
|
-
padding={padding}
|
33
|
-
height={height}
|
34
|
-
width={width}
|
35
|
-
color={color}
|
36
|
-
borderRadius={borderRadius}
|
37
26
|
>
|
38
27
|
{children}
|
39
|
-
|
40
|
-
</ModalContainer>
|
28
|
+
</Modal>
|
41
29
|
);
|
42
30
|
};
|
43
31
|
|
44
32
|
const ModalContainer = styled(Modal)`
|
45
|
-
position: absolute;
|
46
|
-
top: 45%;
|
47
|
-
left: 50%;
|
48
|
-
right: auto;
|
49
|
-
bottom: auto;
|
50
|
-
transform: translate(-50%, -50%);
|
51
33
|
background-color: ${({backgroundColor}) => backgroundColor};
|
52
34
|
border-radius: ${({borderRadius}) => borderRadius}px;
|
53
35
|
box-shadow: ${({boxShadow}) => boxShadow};
|
54
|
-
height: ${({height}) => height};
|
55
|
-
width: ${({width}) => width};
|
56
36
|
color: ${({color}) => color};
|
57
37
|
border-color: ${({borderColor}) => borderColor};
|
58
38
|
padding: ${({padding}) => padding}px;
|
@@ -69,8 +49,6 @@ ReactModalComponent.propTypes = {
|
|
69
49
|
|
70
50
|
ReactModalComponent.defaultProps = {
|
71
51
|
title: "",
|
72
|
-
height: "80vh",
|
73
|
-
width: "50vw",
|
74
52
|
};
|
75
53
|
|
76
54
|
export default ReactModalComponent;
|
@@ -1,13 +1,24 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { useEffect } from 'react';
|
2
2
|
import styled from 'styled-components';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
|
5
|
-
import { Formik, Form } from 'formik';
|
5
|
+
import { useFormikContext, Formik, Form } from 'formik';
|
6
6
|
import ReusableHeader from '../ReusableHeader/ReusableHeader';
|
7
7
|
import Buttons from '../../Buttons/Buttons/Buttons';
|
8
8
|
|
9
9
|
const ReusableForm = ({ formTitle, sections, initialValues, ...props }) => {
|
10
10
|
|
11
|
+
const AutoSubmitToken = () => {
|
12
|
+
const { values, submitForm } = useFormikContext();
|
13
|
+
useEffect(() => {
|
14
|
+
if (props.handleChange) {
|
15
|
+
props.handleChange(values)
|
16
|
+
}
|
17
|
+
}, [values, submitForm]);
|
18
|
+
return null;
|
19
|
+
|
20
|
+
};
|
21
|
+
|
11
22
|
const submitHandler = (values) => {
|
12
23
|
props.saveHandler(values)
|
13
24
|
}
|
@@ -18,9 +29,9 @@ const ReusableForm = ({ formTitle, sections, initialValues, ...props }) => {
|
|
18
29
|
|
19
30
|
return (
|
20
31
|
<Formik
|
21
|
-
|
22
|
-
|
23
|
-
|
32
|
+
initialValues={initialValues}
|
33
|
+
validationSchema={props.formSchema}
|
34
|
+
onSubmit={values => submitHandler(values)}
|
24
35
|
>
|
25
36
|
<CreateForm {...props}>
|
26
37
|
<ReusableHeader title={formTitle} {...props.headerStyles} />
|
@@ -51,7 +62,7 @@ const ReusableForm = ({ formTitle, sections, initialValues, ...props }) => {
|
|
51
62
|
size="md"
|
52
63
|
variant="primary"
|
53
64
|
type="submit"
|
54
|
-
buttonClicked={() => {}}
|
65
|
+
buttonClicked={() => { }}
|
55
66
|
/>
|
56
67
|
{
|
57
68
|
props.cancelBtnText &&
|
@@ -63,6 +74,7 @@ const ReusableForm = ({ formTitle, sections, initialValues, ...props }) => {
|
|
63
74
|
buttonClicked={handleCancel} />
|
64
75
|
}
|
65
76
|
</FormFooter>}
|
77
|
+
<AutoSubmitToken />
|
66
78
|
</CreateForm>
|
67
79
|
</Formik>
|
68
80
|
)
|
@@ -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 = ({
|
@@ -23,8 +30,25 @@ const AlbumsGallery = ({
|
|
23
30
|
cardTitleFontSize,
|
24
31
|
countColor,
|
25
32
|
countFontSize,
|
33
|
+
community,
|
26
34
|
...props }) => {
|
27
|
-
const [showModal, setShowModal] = useState(false)
|
35
|
+
const [showModal, setShowModal] = useState(false);
|
36
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
37
|
+
const [centerContext, setCenterContext] = useState(<AlbumsGallery preview={true} videoAlbums={videoAlbums} />)
|
38
|
+
|
39
|
+
const formChanged = (values) => {
|
40
|
+
setCenterContext(<AlbumsGallery preview={true} videoAlbums={videoAlbums} {...values} />)
|
41
|
+
}
|
42
|
+
|
43
|
+
let tabs = [
|
44
|
+
{
|
45
|
+
title: 'New', id: 'preview'
|
46
|
+
},
|
47
|
+
{
|
48
|
+
title: 'Context', id: 'community'
|
49
|
+
}
|
50
|
+
]
|
51
|
+
|
28
52
|
|
29
53
|
const cardStyles = {
|
30
54
|
cardBackgroundColor,
|
@@ -51,12 +75,17 @@ const AlbumsGallery = ({
|
|
51
75
|
}
|
52
76
|
|
53
77
|
const onIconClicked = (action) => {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
78
|
+
if (!props.preview) {
|
79
|
+
switch (action) {
|
80
|
+
case 'add':
|
81
|
+
setShowModal(true)
|
82
|
+
break;
|
83
|
+
case 'config':
|
84
|
+
setShowConfigModal(true)
|
85
|
+
break;
|
86
|
+
default:
|
87
|
+
break;
|
88
|
+
}
|
60
89
|
}
|
61
90
|
}
|
62
91
|
|
@@ -73,6 +102,11 @@ const AlbumsGallery = ({
|
|
73
102
|
setShowModal(false)
|
74
103
|
}
|
75
104
|
|
105
|
+
const cancelConfig = () => {
|
106
|
+
setShowConfigModal(false);
|
107
|
+
localStorage.removeItem('formStyles')
|
108
|
+
}
|
109
|
+
|
76
110
|
return (
|
77
111
|
<Container>
|
78
112
|
<Gallery
|
@@ -81,14 +115,6 @@ const AlbumsGallery = ({
|
|
81
115
|
type="flat"
|
82
116
|
cardStyle="card-style-6"
|
83
117
|
columnsNumber={3}
|
84
|
-
headerStyles={{
|
85
|
-
padding: 10,
|
86
|
-
headerBackground: '#FE1744',
|
87
|
-
titleColor: '#ffff',
|
88
|
-
controlsStyles: {
|
89
|
-
iconSize: 25
|
90
|
-
}
|
91
|
-
}}
|
92
118
|
iconClicked={onIconClicked}
|
93
119
|
galleryColumnGap={10}
|
94
120
|
galleryRowGap={20}
|
@@ -97,6 +123,7 @@ const AlbumsGallery = ({
|
|
97
123
|
cardClicked={() => null}
|
98
124
|
cardIconClicked={cardIconClicked}
|
99
125
|
customCardStyles={cardStyles}
|
126
|
+
{...props}
|
100
127
|
/>
|
101
128
|
<Modal
|
102
129
|
modalIsOpen={showModal}
|
@@ -108,7 +135,28 @@ const AlbumsGallery = ({
|
|
108
135
|
saveHandler={onAddAlbum}
|
109
136
|
cancelHandler={cancelHandler} />
|
110
137
|
</Modal>
|
111
|
-
|
138
|
+
<Modal
|
139
|
+
modalIsOpen={showConfigModal}
|
140
|
+
closeModal={cancelConfig}
|
141
|
+
exitModalButton={(e) => (
|
142
|
+
<div></div>
|
143
|
+
)}>
|
144
|
+
<Tabs
|
145
|
+
title="Video Gallery Config"
|
146
|
+
tabs={tabs}
|
147
|
+
id='styling'
|
148
|
+
>
|
149
|
+
<VideoAlbumsPreview
|
150
|
+
componentProps={{ videoAlbums, preview: true }}
|
151
|
+
formChanged={formChanged}
|
152
|
+
id="preview" />
|
153
|
+
<Community
|
154
|
+
center={centerContext}
|
155
|
+
community={community}
|
156
|
+
id="community" />
|
157
|
+
</Tabs>
|
158
|
+
</Modal>
|
159
|
+
</Container >
|
112
160
|
)
|
113
161
|
}
|
114
162
|
|
@@ -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,
|
@@ -25,10 +38,50 @@ const VideoSpace = ({
|
|
25
38
|
commentBackgroundColor,
|
26
39
|
commentTitleColor,
|
27
40
|
commentTitleFontSize,
|
41
|
+
community,
|
28
42
|
...props }) => {
|
43
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
44
|
+
const [centerContext, setCenterContext] = useState(<VideoSpace users={users} preview={true} videoSrc={videoSrc} comments={comments} />)
|
45
|
+
|
46
|
+
const formChanged = (values) => {
|
47
|
+
setCenterContext(<VideoSpace users={users} preview={true} videoSrc={videoSrc} comments={comments} {...values} />)
|
48
|
+
}
|
49
|
+
|
50
|
+
let tabs = [
|
51
|
+
{
|
52
|
+
title: 'New', id: 'preview'
|
53
|
+
},
|
54
|
+
{
|
55
|
+
title: 'Context', id: 'community'
|
56
|
+
}
|
57
|
+
]
|
58
|
+
|
59
|
+
|
60
|
+
const iconClicked = (action) => {
|
61
|
+
if (!props.preview) {
|
62
|
+
switch (action) {
|
63
|
+
case 'config':
|
64
|
+
setShowConfigModal(true)
|
65
|
+
break;
|
66
|
+
default:
|
67
|
+
break;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
const cancelConfig = () => {
|
73
|
+
setShowConfigModal(false);
|
74
|
+
localStorage.removeItem('formStyles')
|
75
|
+
}
|
29
76
|
|
30
77
|
return (
|
31
78
|
<Container backgroundColor={backgroundColor}>
|
79
|
+
<ReusableHeader
|
80
|
+
title={title || 'Video Space'}
|
81
|
+
controls={controls}
|
82
|
+
iconClicked={iconClicked}
|
83
|
+
{...props.headerStyles}
|
84
|
+
/>
|
32
85
|
<VideoPlayer
|
33
86
|
iconsColor={iconsColor}
|
34
87
|
src={videoSrc} />
|
@@ -47,6 +100,29 @@ const VideoSpace = ({
|
|
47
100
|
<RichTextInput
|
48
101
|
users={users}
|
49
102
|
/>
|
103
|
+
<Modal
|
104
|
+
modalIsOpen={showConfigModal}
|
105
|
+
closeModal={cancelConfig}
|
106
|
+
exitModalButton={(e) => (
|
107
|
+
<div></div>
|
108
|
+
)}
|
109
|
+
>
|
110
|
+
<Tabs
|
111
|
+
title="Video Space Config"
|
112
|
+
tabs={tabs}
|
113
|
+
id='styling'
|
114
|
+
>
|
115
|
+
<VideoPreview
|
116
|
+
componentProps={{ title, discription, comments, date, preview: true }}
|
117
|
+
formChanged={formChanged}
|
118
|
+
id="preview" />
|
119
|
+
|
120
|
+
<Community
|
121
|
+
center={centerContext}
|
122
|
+
community={community}
|
123
|
+
id="community" />
|
124
|
+
</Tabs>
|
125
|
+
</Modal>
|
50
126
|
</Container>
|
51
127
|
)
|
52
128
|
}
|