@mohamed-karawia/library 0.1.15 → 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 +127 -33
- package/dist/stories/Common Inputs/EditorComponent/EditorComponent.js +4 -2
- 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/Enrollment/Admin/CreateForm/CreateForm.js +1 -1
- package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.js +11 -23
- package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +2 -17
- package/dist/stories/Enrollment/Guest/FillForm/FillForm.js +4 -17
- package/dist/stories/Events/Event/Event.js +117 -5
- package/dist/stories/Events/EventsList/EventsList.js +98 -19
- package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
- package/dist/stories/Library/Folders/Folders.js +82 -7
- package/dist/stories/Library/Notes/Notes.js +78 -4
- package/dist/stories/Library/ViewNote/ViewNote.js +7 -10
- package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
- package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +139 -23
- package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +70 -34
- package/dist/stories/Navbar/Navbar.js +15 -45
- package/dist/stories/Pages/Chat/Chat.js +13 -1
- package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +19 -1
- package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +7 -1
- package/dist/stories/Pages/Enrollment/Forms/Forms.js +24 -2
- package/dist/stories/Pages/Events/Event/Event.js +14 -5
- package/dist/stories/Pages/Events/Events/Events.js +1 -0
- package/dist/stories/Pages/Library/Folders/Library.js +7 -1
- package/dist/stories/Pages/Music/MusicAlbum/Music.js +12 -5
- package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +34 -5
- package/dist/stories/Pages/Photos/Album/Album.js +7 -1
- package/dist/stories/Pages/Photos/Albums/Albums.js +38 -2
- package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +80 -27
- package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +85 -60
- package/dist/stories/Preview/Preview.js +37 -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 +10 -5
- package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +8 -4
- package/dist/stories/Reusable Components/Cards/Card-style-3/CardStyle3.js +3 -2
- 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/Card-style-9/CardStyle9.js +26 -15
- package/dist/stories/Reusable Components/Cards/globalCardStyles.js +3 -3
- package/dist/stories/Reusable Components/Community/Community.js +76 -0
- package/dist/stories/Reusable Components/Gallery/Gallery.js +17 -18
- package/dist/stories/Reusable Components/ReactModal/ReactModal.js +11 -30
- package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +20 -3
- package/dist/stories/Reusable Components/ReusableList/ReusableList.js +15 -9
- package/dist/stories/Reusable Components/Tabs/Tabs.js +68 -0
- package/dist/stories/Sections/Sections.js +67 -0
- 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 +78 -5
- package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +17 -11
- package/dist/stories/Widgets/SpacesListWidget/SpacesListWidget.js +115 -0
- package/dist/stories/Widgets/UsersWidget/UsersWidget.js +30 -0
- package/dist/stories/helpers/util.js +70 -7
- 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 +109 -35
- package/src/stories/Common Inputs/EditorComponent/EditorComponent.jsx +3 -3
- 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/Enrollment/Admin/CreateForm/CreateForm.jsx +1 -0
- package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.jsx +8 -19
- package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +3 -17
- package/src/stories/Enrollment/Guest/FillForm/FillForm.jsx +6 -16
- package/src/stories/Events/Event/Event.jsx +98 -5
- package/src/stories/Events/EventsList/EventsList.jsx +101 -22
- package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
- package/src/stories/Library/Folders/Folders.jsx +82 -8
- package/src/stories/Library/Notes/Notes.jsx +65 -5
- package/src/stories/Library/ViewNote/ViewNote.jsx +1 -12
- package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
- package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +133 -21
- package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +62 -36
- package/src/stories/Navbar/Navbar.jsx +51 -49
- package/src/stories/Pages/Chat/Chat.jsx +17 -4
- package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +20 -1
- package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +6 -0
- package/src/stories/Pages/Enrollment/Forms/Forms.jsx +23 -1
- package/src/stories/Pages/Events/Event/Event.jsx +12 -4
- package/src/stories/Pages/Events/Events/Events.jsx +75 -74
- package/src/stories/Pages/Library/Folders/Library.jsx +7 -1
- package/src/stories/Pages/Music/MusicAlbum/Music.jsx +16 -8
- package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +28 -27
- package/src/stories/Pages/Photos/Album/Album.jsx +7 -1
- package/src/stories/Pages/Photos/Albums/Albums.jsx +25 -20
- package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +63 -21
- package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +65 -66
- package/src/stories/Preview/Preview.jsx +35 -0
- 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 +13 -6
- package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -5
- package/src/stories/Reusable Components/Cards/Card-style-3/CardStyle3.jsx +5 -2
- 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/Card-style-9/CardStyle9.jsx +12 -8
- package/src/stories/Reusable Components/Cards/globalCardStyles.js +3 -2
- package/src/stories/Reusable Components/Community/Community.jsx +70 -0
- package/src/stories/Reusable Components/Gallery/Gallery.jsx +15 -10
- package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +3 -25
- package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +19 -7
- package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.jsx +0 -2
- package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +24 -8
- package/src/stories/Reusable Components/Tabs/Tabs.jsx +67 -0
- package/src/stories/Sections/Sections.jsx +56 -0
- 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 +65 -8
- package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +14 -7
- package/src/stories/Widgets/SpacesListWidget/SpacesListWidget.jsx +78 -0
- package/src/stories/Widgets/UsersWidget/UsersWidget.jsx +20 -0
- package/src/stories/helpers/util.js +50 -6
- package/src/stories/store/communities.js +705 -0
- package/src/stories/store/store.js +33 -0
- package/src/stories/styling.json +92 -0
@@ -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,13 +74,14 @@ 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
|
)
|
69
81
|
}
|
70
82
|
|
71
83
|
const CreateForm = styled(Form)`
|
72
|
-
background-color: ${props => props.formBackgroundColor || '
|
84
|
+
background-color: ${props => props.formBackgroundColor || 'transparent'};
|
73
85
|
display: flex;
|
74
86
|
flex-direction: column;
|
75
87
|
|
@@ -63,8 +63,6 @@ ReusableHeader.propTypes = {
|
|
63
63
|
controlsStyles: PropTypes.object,
|
64
64
|
headerBackground: PropTypes.string,
|
65
65
|
padding: PropTypes.number,
|
66
|
-
horizontalPadding: PropTypes.number,
|
67
|
-
headerMarginBottom: PropTypes.number,
|
68
66
|
titleColor: PropTypes.string,
|
69
67
|
titleFontSize: PropTypes.number,
|
70
68
|
titleFontWeight: PropTypes.number,
|
@@ -4,22 +4,36 @@ 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
|
-
const ReusableList = ({
|
9
|
+
const ReusableList = ({
|
10
|
+
data,
|
11
|
+
cardStyle,
|
12
|
+
customCardStyles,
|
13
|
+
type,
|
14
|
+
cardControls = null,
|
15
|
+
headerStyles,
|
16
|
+
sectionHeaderStyles,
|
17
|
+
...props
|
18
|
+
}) => {
|
11
19
|
let child;
|
12
20
|
|
13
21
|
const iconCliked = (action) => {
|
14
|
-
props.iconClicked
|
22
|
+
if (props.iconClicked) {
|
23
|
+
props.iconClicked(action)
|
24
|
+
}
|
15
25
|
}
|
16
26
|
|
17
27
|
const clicked = (index, cardProps) => {
|
18
|
-
props.cardClicked
|
28
|
+
if (props.cardClicked) {
|
29
|
+
props.cardClicked(index, cardProps)
|
30
|
+
}
|
19
31
|
}
|
20
32
|
|
21
33
|
const cardIconClicked = (action, index) => {
|
22
|
-
props.cardIconClicked
|
34
|
+
if (props.cardIconClicked) {
|
35
|
+
props.cardIconClicked(action, index)
|
36
|
+
}
|
23
37
|
}
|
24
38
|
|
25
39
|
const mapOverCardsData = (data) => {
|
@@ -33,7 +47,7 @@ const ReusableList = ({ data, cardStyle, customCardStyles, type, cardControls =
|
|
33
47
|
} else {
|
34
48
|
child = data.map(section => (
|
35
49
|
<Section priority={section.priority}>
|
36
|
-
<
|
50
|
+
<ReusableHeader title={section.title} {...sectionHeaderStyles} />
|
37
51
|
<SectionBody>
|
38
52
|
{mapOverCardsData(section.data)}
|
39
53
|
</SectionBody>
|
@@ -48,7 +62,7 @@ const ReusableList = ({ data, cardStyle, customCardStyles, type, cardControls =
|
|
48
62
|
title={props.listTitle}
|
49
63
|
controls={props.listControls}
|
50
64
|
iconClicked={iconCliked}
|
51
|
-
{...
|
65
|
+
{...headerStyles}
|
52
66
|
/>}
|
53
67
|
<ListBody {...props}>
|
54
68
|
{child}
|
@@ -97,7 +111,9 @@ ReusableList.propTypes = {
|
|
97
111
|
customCardStyles: PropTypes.object,
|
98
112
|
listRowGap: PropTypes.number,
|
99
113
|
listTitle: PropTypes.string,
|
100
|
-
hideTitle: PropTypes.bool
|
114
|
+
hideTitle: PropTypes.bool,
|
115
|
+
headerStyles: PropTypes.object,
|
116
|
+
sectionHeaderStyles: PropTypes.object
|
101
117
|
};
|
102
118
|
|
103
119
|
export default ReusableList
|
@@ -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;
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import React, {useState} from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import styled from 'styled-components';
|
4
|
+
|
5
|
+
import ReusableList from '../Reusable Components/ReusableList/ReusableList';
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
const Sections = ({sections, ...props}) => {
|
10
|
+
const [center, setCenter] = useState(props.children[0] || props.children)
|
11
|
+
console.log('renders')
|
12
|
+
|
13
|
+
const cardClicked = (index, cardProps) => {
|
14
|
+
let child = props.children.find(child => child.props.id === cardProps.id)
|
15
|
+
setCenter(child)
|
16
|
+
console.log(child)
|
17
|
+
}
|
18
|
+
|
19
|
+
return (
|
20
|
+
<Container {...props}>
|
21
|
+
<Left>
|
22
|
+
<ReusableList
|
23
|
+
type='sectioned'
|
24
|
+
data={sections}
|
25
|
+
cardStyle='card-style-3'
|
26
|
+
cardClicked={cardClicked}
|
27
|
+
{...props}
|
28
|
+
/>
|
29
|
+
</Left>
|
30
|
+
<Center>{center}</Center>
|
31
|
+
</Container>
|
32
|
+
)
|
33
|
+
}
|
34
|
+
|
35
|
+
const Container = styled.div`
|
36
|
+
background-color: ${props => props.backgroundColor};
|
37
|
+
background-color: #414141;
|
38
|
+
display: flex;
|
39
|
+
`
|
40
|
+
|
41
|
+
const Left = styled.div`
|
42
|
+
flex: 1;
|
43
|
+
`
|
44
|
+
|
45
|
+
const Center = styled.div`
|
46
|
+
flex: 3;
|
47
|
+
`
|
48
|
+
|
49
|
+
Sections.defaultProps = {};
|
50
|
+
|
51
|
+
Sections.propTypes = {
|
52
|
+
sections: PropTypes.array.isRequired,
|
53
|
+
backgroundColor: PropTypes.string,
|
54
|
+
}
|
55
|
+
|
56
|
+
export default Sections;
|
@@ -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
|
}
|
@@ -75,13 +114,10 @@ const ViewAlbum = ({
|
|
75
114
|
return (
|
76
115
|
<Container>
|
77
116
|
<Gallery
|
78
|
-
galleryTitle="Video Album"
|
117
|
+
galleryTitle={props.title || "Video Album"}
|
79
118
|
data={album}
|
80
119
|
type="flat"
|
81
120
|
cardStyle="card-style-6"
|
82
|
-
columnsNumber={3}
|
83
|
-
galleryColumnGap={10}
|
84
|
-
galleryRowGap={20}
|
85
121
|
galleryControls={galleryControls}
|
86
122
|
iconClicked={onHeaderIconClicked}
|
87
123
|
cardControls={cardControls}
|
@@ -99,6 +135,26 @@ const ViewAlbum = ({
|
|
99
135
|
saveHandler={onAddVideo}
|
100
136
|
cancelHandler={cancelHandler} />
|
101
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>
|
102
158
|
</Container>
|
103
159
|
)
|
104
160
|
}
|
@@ -116,7 +172,8 @@ ViewAlbum.propTypes = {
|
|
116
172
|
cardTitleFontSize: PropTypes.number,
|
117
173
|
descColor: PropTypes.string,
|
118
174
|
cardIconClicked: PropTypes.func,
|
119
|
-
onAddAlbum: PropTypes.func
|
175
|
+
onAddAlbum: PropTypes.func,
|
176
|
+
title: PropTypes.string
|
120
177
|
}
|
121
178
|
|
122
179
|
export default ViewAlbum
|