@mohamed-karawia/library 0.1.17 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. package/dist/stories/Chat/Chat.js +129 -14
  2. package/dist/stories/Common Inputs/Picker/Picker.js +61 -0
  3. package/dist/stories/Common Inputs/TextField/TextField.js +3 -1
  4. package/dist/stories/Community/Community.js +137 -0
  5. package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.js +10 -12
  6. package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +1 -1
  7. package/dist/stories/Enrollment/Guest/FillForm/FillForm.js +4 -17
  8. package/dist/stories/Events/Event/Event.js +116 -5
  9. package/dist/stories/Events/EventsList/EventsList.js +94 -19
  10. package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
  11. package/dist/stories/Library/Folders/Folders.js +77 -5
  12. package/dist/stories/Library/Notes/Notes.js +78 -4
  13. package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
  14. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +137 -15
  15. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +67 -28
  16. package/dist/stories/Navbar/Navbar.js +1 -1
  17. package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +8 -0
  18. package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +7 -1
  19. package/dist/stories/Pages/Enrollment/Forms/Forms.js +3 -1
  20. package/dist/stories/Pages/Events/Event/Event.js +14 -5
  21. package/dist/stories/Pages/Events/Events/Events.js +1 -0
  22. package/dist/stories/Pages/Music/MusicAlbum/Music.js +8 -6
  23. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -15
  24. package/dist/stories/Pages/Photos/Albums/Albums.js +4 -1
  25. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +80 -19
  26. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +83 -25
  27. package/dist/stories/Preview/Preview.js +37 -0
  28. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +193 -0
  29. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +158 -0
  30. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +192 -0
  31. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +182 -0
  32. package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +177 -0
  33. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +181 -0
  34. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +153 -0
  35. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +112 -0
  36. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +173 -0
  37. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +189 -0
  38. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +189 -0
  39. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +197 -0
  40. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +189 -0
  41. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +175 -0
  42. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +172 -0
  43. package/dist/stories/PreviewComponents/globalStyles.js +26 -0
  44. package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +4 -3
  45. package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +8 -4
  46. package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.js +10 -4
  47. package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.js +4 -2
  48. package/dist/stories/Reusable Components/Cards/globalCardStyles.js +2 -2
  49. package/dist/stories/Reusable Components/Community/Community.js +75 -0
  50. package/dist/stories/Reusable Components/Gallery/Gallery.js +17 -18
  51. package/dist/stories/Reusable Components/ReactModal/ReactModal.js +11 -30
  52. package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +20 -3
  53. package/dist/stories/Reusable Components/ReusableList/ReusableList.js +9 -5
  54. package/dist/stories/Reusable Components/Tabs/Tabs.js +68 -0
  55. package/dist/stories/Sections/Sections.js +8 -2
  56. package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +77 -18
  57. package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +96 -3
  58. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +78 -5
  59. package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +17 -11
  60. package/dist/stories/Widgets/SpacesListWidget/SpacesListWidget.js +115 -0
  61. package/dist/stories/Widgets/UsersWidget/UsersWidget.js +30 -0
  62. package/dist/stories/helpers/util.js +60 -3
  63. package/dist/stories/store/communities.js +943 -0
  64. package/dist/stories/store/store.js +44 -0
  65. package/package.json +5 -2
  66. package/src/stories/Chat/Chat.jsx +109 -13
  67. package/src/stories/Common Inputs/Picker/Picker.jsx +47 -0
  68. package/src/stories/Common Inputs/TextField/TextField.jsx +1 -1
  69. package/src/stories/Community/Community.jsx +110 -0
  70. package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.jsx +7 -9
  71. package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +3 -2
  72. package/src/stories/Enrollment/Guest/FillForm/FillForm.jsx +6 -16
  73. package/src/stories/Events/Event/Event.jsx +98 -5
  74. package/src/stories/Events/EventsList/EventsList.jsx +101 -22
  75. package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
  76. package/src/stories/Library/Folders/Folders.jsx +81 -5
  77. package/src/stories/Library/Notes/Notes.jsx +65 -5
  78. package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
  79. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +133 -14
  80. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +61 -32
  81. package/src/stories/Navbar/Navbar.jsx +1 -1
  82. package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +10 -1
  83. package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +6 -0
  84. package/src/stories/Pages/Enrollment/Forms/Forms.jsx +3 -1
  85. package/src/stories/Pages/Events/Event/Event.jsx +12 -4
  86. package/src/stories/Pages/Events/Events/Events.jsx +75 -74
  87. package/src/stories/Pages/Library/Folders/Library.jsx +1 -1
  88. package/src/stories/Pages/Music/MusicAlbum/Music.jsx +8 -6
  89. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +0 -13
  90. package/src/stories/Pages/Photos/Albums/Albums.jsx +3 -0
  91. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +63 -13
  92. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +66 -33
  93. package/src/stories/Preview/Preview.jsx +35 -0
  94. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +132 -0
  95. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +116 -0
  96. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +132 -0
  97. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +127 -0
  98. package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +124 -0
  99. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +126 -0
  100. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +113 -0
  101. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +93 -0
  102. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +122 -0
  103. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +129 -0
  104. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +129 -0
  105. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +138 -0
  106. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +129 -0
  107. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +124 -0
  108. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +125 -0
  109. package/src/stories/PreviewComponents/globalStyles.js +20 -0
  110. package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +5 -2
  111. package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -5
  112. package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.jsx +12 -6
  113. package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.jsx +2 -2
  114. package/src/stories/Reusable Components/Cards/globalCardStyles.js +2 -1
  115. package/src/stories/Reusable Components/Community/Community.jsx +70 -0
  116. package/src/stories/Reusable Components/Gallery/Gallery.jsx +15 -10
  117. package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +3 -25
  118. package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +19 -7
  119. package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.jsx +0 -2
  120. package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +9 -4
  121. package/src/stories/Reusable Components/Tabs/Tabs.jsx +67 -0
  122. package/src/stories/Sections/Sections.jsx +5 -2
  123. package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +57 -16
  124. package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +70 -1
  125. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +65 -8
  126. package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +14 -7
  127. package/src/stories/Widgets/SpacesListWidget/SpacesListWidget.jsx +78 -0
  128. package/src/stories/Widgets/UsersWidget/UsersWidget.jsx +20 -0
  129. package/src/stories/helpers/util.js +42 -2
  130. package/src/stories/store/communities.js +705 -0
  131. package/src/stories/store/store.js +33 -0
  132. package/src/stories/styling.json +92 -0
@@ -17,42 +17,22 @@ const ReactModalComponent = ({
17
17
  closeModal,
18
18
  children,
19
19
  exitModalButton,
20
- onOverlayCloseClick
20
+ shouldCloseOnOverlayClick
21
21
  }) => {
22
22
  return (
23
- <ModalContainer
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
- {exitModalButton(closeModal)}
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
- initialValues={initialValues}
22
- validationSchema={props.formSchema}
23
- onSubmit={values => submitHandler(values)}
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 || 'white'};
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,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(action)
22
+ if (props.iconClicked) {
23
+ props.iconClicked(action)
24
+ }
24
25
  }
25
26
 
26
27
  const clicked = (index, cardProps) => {
27
- props.cardClicked(index, cardProps)
28
+ if (props.cardClicked) {
29
+ props.cardClicked(index, cardProps)
30
+ }
28
31
  }
29
32
 
30
33
  const cardIconClicked = (action, index) => {
31
- props.cardIconClicked(action, index)
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(sections[0].data[0].component)
10
+ const [center, setCenter] = useState(props.children[0] || props.children)
11
+ console.log('renders')
11
12
 
12
13
  const cardClicked = (index, cardProps) => {
13
- setCenter(cardProps.component)
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
- switch (action) {
55
- case 'add':
56
- setShowModal(true)
57
- break;
58
- default:
59
- break;
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
- </Container>
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
- ...props}) => {
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
@@ -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,14 +39,18 @@ 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 || 'inherit'};
47
- background-color: ${props => props.backgroundColor || 'inherit'};
52
+ font-family: ${props => props.fontFamily || 'sans-serif'};
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;
50
56
  width: ${props => props.width}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`