@mohamed-karawia/library 0.1.16 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/stories/Chat/Chat.js +129 -14
- 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/DetailedForm/DetailedForm.js +10 -12
- package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +1 -1
- 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 -6
- package/dist/stories/Library/Notes/Notes.js +78 -4
- package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
- package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +138 -15
- package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +67 -28
- package/dist/stories/Navbar/Navbar.js +1 -1
- package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +8 -0
- package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +7 -1
- package/dist/stories/Pages/Enrollment/Forms/Forms.js +3 -1
- 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 +2 -1
- package/dist/stories/Pages/Music/MusicAlbum/Music.js +8 -6
- package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -15
- package/dist/stories/Pages/Photos/Albums/Albums.js +4 -1
- package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +80 -19
- package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +83 -25
- 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 +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 +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 +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 +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 +60 -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 +109 -13
- 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/DetailedForm/DetailedForm.jsx +7 -9
- package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +3 -2
- 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 -6
- package/src/stories/Library/Notes/Notes.jsx +65 -5
- package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
- package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +133 -14
- package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +61 -32
- package/src/stories/Navbar/Navbar.jsx +1 -1
- package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +10 -1
- package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +6 -0
- package/src/stories/Pages/Enrollment/Forms/Forms.jsx +3 -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 +2 -1
- package/src/stories/Pages/Music/MusicAlbum/Music.jsx +8 -6
- package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +0 -13
- package/src/stories/Pages/Photos/Albums/Albums.jsx +3 -0
- package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +63 -13
- package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +66 -33
- 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 +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 +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 +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 +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 +42 -2
- package/src/stories/store/communities.js +705 -0
- package/src/stories/store/store.js +33 -0
- package/src/stories/styling.json +92 -0
@@ -1,9 +1,22 @@
|
|
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 { BsGear } from "react-icons/bs";
|
5
6
|
import ReusableHeader from '../../Reusable Components/ReusableHeader/ReusableHeader';
|
7
|
+
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
|
+
import EventPreview from '../../PreviewComponents/EventPreview/EventPreview';
|
6
9
|
|
10
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
11
|
+
import Sections from '../../Sections/Sections';
|
12
|
+
import WidgetContainer from "../../Reusable Components/WidgetContainer/WidgetContainer";
|
13
|
+
import Community from '../../Reusable Components/Community/Community';
|
14
|
+
// import styles from '../../styling.json'
|
15
|
+
|
16
|
+
|
17
|
+
const listControls = [
|
18
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
19
|
+
]
|
7
20
|
const Event = ({
|
8
21
|
cover,
|
9
22
|
title,
|
@@ -16,13 +29,55 @@ const Event = ({
|
|
16
29
|
dateSize,
|
17
30
|
discColor,
|
18
31
|
discSize,
|
19
|
-
headerStyles
|
32
|
+
headerStyles,
|
33
|
+
...props
|
20
34
|
}) => {
|
35
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
36
|
+
const [centerContext, setCenterContext] = useState(<Event title={title} cover={cover} date={date} disc={disc}/>)
|
37
|
+
|
38
|
+
const formChanged = (values) => {
|
39
|
+
setCenterContext(<Event title={title} cover={cover} date={date} disc={disc} {...values} />)
|
40
|
+
}
|
41
|
+
|
42
|
+
let tabs = [
|
43
|
+
{
|
44
|
+
title: 'New', id: 'preview'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
title: 'Context', id: 'community'
|
48
|
+
}
|
49
|
+
]
|
50
|
+
|
51
|
+
let sections = [
|
52
|
+
{
|
53
|
+
title: 'Styles',
|
54
|
+
data: [
|
55
|
+
{
|
56
|
+
title: 'Styling',
|
57
|
+
id: 'styling'
|
58
|
+
}
|
59
|
+
]
|
60
|
+
}
|
61
|
+
]
|
62
|
+
|
63
|
+
const onIconClicked = (action) => {
|
64
|
+
if (!props.preview) {
|
65
|
+
switch (action) {
|
66
|
+
case 'config':
|
67
|
+
setShowConfigModal(true)
|
68
|
+
break;
|
69
|
+
default:
|
70
|
+
break;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
21
74
|
return (
|
22
75
|
<Container
|
23
76
|
backgroundColor={backgroundColor}>
|
24
77
|
<ReusableHeader
|
25
78
|
title={title}
|
79
|
+
controls={listControls}
|
80
|
+
iconClicked={onIconClicked}
|
26
81
|
{...headerStyles}
|
27
82
|
/>
|
28
83
|
<CoverWrapper>
|
@@ -40,6 +95,44 @@ const Event = ({
|
|
40
95
|
{disc}
|
41
96
|
</Disc>
|
42
97
|
</Details>
|
98
|
+
<Modal
|
99
|
+
modalIsOpen={showConfigModal}
|
100
|
+
closeModal={() => setShowConfigModal(false)}
|
101
|
+
exitModalButton={(e) => (
|
102
|
+
<div></div>
|
103
|
+
)}
|
104
|
+
>
|
105
|
+
{/* <Sections
|
106
|
+
sections={sections}
|
107
|
+
backgroundColor={'white'}
|
108
|
+
sectionHeaderStyles={{
|
109
|
+
titleColor: 'white',
|
110
|
+
headerBackground: 'transparent'
|
111
|
+
}}
|
112
|
+
customCardStyles={{
|
113
|
+
cardPadding: 6,
|
114
|
+
cardTitleFontSize: 15,
|
115
|
+
cardBackgroundColor: '#2c2c2c',
|
116
|
+
cardTitleColor: 'white',
|
117
|
+
onHoverBackgroundColor: '#555555',
|
118
|
+
controlsStyles: {
|
119
|
+
showOnHover: true,
|
120
|
+
}
|
121
|
+
}} /> */}
|
122
|
+
<Tabs
|
123
|
+
title="Event Config"
|
124
|
+
tabs={tabs}
|
125
|
+
>
|
126
|
+
<EventPreview
|
127
|
+
componentProps={{ cover, title, date, disc, preview: true }}
|
128
|
+
formChanged={formChanged}
|
129
|
+
id='preview'
|
130
|
+
/>
|
131
|
+
<Community
|
132
|
+
center={centerContext}
|
133
|
+
id="community" />
|
134
|
+
</Tabs>
|
135
|
+
</Modal>
|
43
136
|
</Container>
|
44
137
|
)
|
45
138
|
}
|
@@ -47,7 +140,7 @@ const Event = ({
|
|
47
140
|
const Container = styled.div`
|
48
141
|
width: 100%;
|
49
142
|
font-family: sans-serif;
|
50
|
-
background-color: ${({ backgroundColor }) => backgroundColor};
|
143
|
+
background-color: ${({ backgroundColor }) => backgroundColor || 'transparent'};
|
51
144
|
`
|
52
145
|
|
53
146
|
const CoverWrapper = styled.div`
|
@@ -101,10 +194,10 @@ Event.propTypes = {
|
|
101
194
|
titleSize: PropTypes.number,
|
102
195
|
dateColor: PropTypes.string,
|
103
196
|
dateSize: PropTypes.number,
|
104
|
-
headerBackground: PropTypes.string,
|
105
|
-
headerTitleColor: PropTypes.string,
|
106
197
|
discColor: PropTypes.string,
|
107
198
|
discSize: PropTypes.number,
|
199
|
+
headerStyles: PropTypes.object,
|
200
|
+
peview: PropTypes.bool
|
108
201
|
}
|
109
202
|
|
110
203
|
export default Event
|
@@ -3,12 +3,20 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
4
4
|
|
5
5
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
6
|
+
import { BsGear } from "react-icons/bs";
|
6
7
|
import List from '../../Reusable Components/ReusableList/ReusableList';
|
7
8
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
9
|
import CreateEvent from '../CreateEvent/CreateEvent';
|
10
|
+
import EventsPreview from '../../PreviewComponents/EventsPreview/EventsPreview';
|
11
|
+
// import { Events } from './EventsList.stories';
|
12
|
+
// import { eventsList } from '../../Pages/Events/Events/Events.stories';
|
13
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
14
|
+
import Sections from '../../Sections/Sections';
|
15
|
+
import Community from '../../Reusable Components/Community/Community';
|
9
16
|
|
10
17
|
const listControls = [
|
11
18
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
|
19
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
12
20
|
]
|
13
21
|
|
14
22
|
const cardControls = [
|
@@ -17,31 +25,63 @@ const cardControls = [
|
|
17
25
|
|
18
26
|
const EventsList = ({
|
19
27
|
events,
|
20
|
-
iconColor,
|
21
|
-
cardTitleFontSize,
|
22
|
-
cardTitleColor,
|
23
|
-
cardPadding,
|
24
28
|
...props
|
25
29
|
}) => {
|
26
30
|
|
27
31
|
const [showModal, setShowModal] = useState(false);
|
32
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
33
|
+
const [centerContext, setCenterContext] = useState(<EventsList events={events} />)
|
34
|
+
|
35
|
+
const formChanged = (values) => {
|
36
|
+
setCenterContext(<EventsList events={events} {...values} />)
|
37
|
+
}
|
38
|
+
|
39
|
+
let tabs = [
|
40
|
+
{
|
41
|
+
title: 'New', id: 'preview'
|
42
|
+
},
|
43
|
+
{
|
44
|
+
title: 'Context', id: 'community'
|
45
|
+
}
|
46
|
+
]
|
47
|
+
|
48
|
+
let sections = [
|
49
|
+
{
|
50
|
+
title: 'Styles',
|
51
|
+
data: [
|
52
|
+
{
|
53
|
+
title: 'Styling',
|
54
|
+
id: 'styling'
|
55
|
+
}
|
56
|
+
]
|
57
|
+
}
|
58
|
+
]
|
28
59
|
|
29
60
|
const onIconClicked = (action) => {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
61
|
+
if (!props.preview) {
|
62
|
+
switch (action) {
|
63
|
+
case 'add':
|
64
|
+
setShowModal(true)
|
65
|
+
break;
|
66
|
+
case 'config':
|
67
|
+
setShowConfigModal(true)
|
68
|
+
break;
|
69
|
+
default:
|
70
|
+
break;
|
71
|
+
}
|
36
72
|
}
|
37
73
|
}
|
38
74
|
|
39
75
|
const cardIconClicked = (action, index) => {
|
40
|
-
props.
|
76
|
+
if (!props.preview) {
|
77
|
+
props.cardIconClicked(action, index)
|
78
|
+
}
|
41
79
|
}
|
42
80
|
|
43
|
-
const cardClicked = () => {
|
44
|
-
|
81
|
+
const cardClicked = (index, props) => {
|
82
|
+
if (!props.preview) {
|
83
|
+
props.cardClicked(props)
|
84
|
+
}
|
45
85
|
}
|
46
86
|
|
47
87
|
const cancelHandler = () => {
|
@@ -54,9 +94,9 @@ const EventsList = ({
|
|
54
94
|
}
|
55
95
|
|
56
96
|
return (
|
57
|
-
|
97
|
+
<Container>
|
58
98
|
<List
|
59
|
-
listTitle="My Events"
|
99
|
+
listTitle={props.title || "My Events"}
|
60
100
|
data={events}
|
61
101
|
type='flat'
|
62
102
|
cardStyle="card-style-11"
|
@@ -74,14 +114,51 @@ const EventsList = ({
|
|
74
114
|
<div></div>
|
75
115
|
)}>
|
76
116
|
<CreateEvent
|
77
|
-
saveBtnText=
|
78
|
-
cancelBtnText="Cancel"
|
117
|
+
saveBtnText={props.saveBtnText || 'Create'}
|
118
|
+
cancelBtnText={props.cancelBtnText || "Cancel"}
|
79
119
|
saveHandler={onAddFolder}
|
80
120
|
cancelHandler={cancelHandler}
|
81
121
|
/>
|
82
122
|
</Modal>
|
123
|
+
<Modal
|
124
|
+
modalIsOpen={showConfigModal}
|
125
|
+
closeModal={() => setShowConfigModal(false)}
|
126
|
+
exitModalButton={(e) => (
|
127
|
+
<div></div>
|
128
|
+
)}
|
129
|
+
>
|
130
|
+
{/* <Sections
|
131
|
+
sections={sections}
|
132
|
+
backgroundColor={'white'}
|
133
|
+
sectionHeaderStyles={{
|
134
|
+
titleColor: 'white',
|
135
|
+
headerBackground: 'transparent'
|
136
|
+
}}
|
137
|
+
customCardStyles={{
|
138
|
+
cardPadding: 6,
|
139
|
+
cardTitleFontSize: 15,
|
140
|
+
cardBackgroundColor: '#2c2c2c',
|
141
|
+
cardTitleColor: 'white',
|
142
|
+
onHoverBackgroundColor: '#555555',
|
143
|
+
controlsStyles: {
|
144
|
+
showOnHover: true,
|
145
|
+
}
|
146
|
+
}} /> */}
|
147
|
+
<Tabs
|
148
|
+
title="Event Config"
|
149
|
+
tabs={tabs}>
|
150
|
+
<EventsPreview
|
151
|
+
componentProps={{ events, title: props.title || "My Events", preview: true }}
|
152
|
+
formChanged={formChanged}
|
153
|
+
id='preview'
|
154
|
+
/>
|
155
|
+
<Community
|
156
|
+
center={centerContext}
|
157
|
+
id="community" />
|
158
|
+
</Tabs>
|
159
|
+
</Modal>
|
83
160
|
</Container>
|
84
|
-
|
161
|
+
)
|
85
162
|
}
|
86
163
|
|
87
164
|
const Container = styled.div`
|
@@ -92,10 +169,12 @@ EventsList.defaultProps = {};
|
|
92
169
|
|
93
170
|
EventsList.propTypes = {
|
94
171
|
notes: PropTypes.array.isRequired,
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
172
|
+
title: PropTypes.string,
|
173
|
+
headerStyles: PropTypes.object,
|
174
|
+
customCardStyles: PropTypes.object,
|
175
|
+
saveBtnText: PropTypes.string,
|
176
|
+
cancelBtnText: PropTypes.string,
|
177
|
+
preview: PropTypes.bool
|
99
178
|
}
|
100
179
|
|
101
180
|
export default EventsList
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import * as Yup from 'yup';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import ReusableForm from '../../Reusable Components/ReusableForm/ReusableForm';
|
7
|
+
import TextField from '../../Common Inputs/TextField/TextField';
|
8
|
+
|
9
|
+
const CreateSpace = (props) => {
|
10
|
+
|
11
|
+
const initialValues = {
|
12
|
+
title: ''
|
13
|
+
}
|
14
|
+
|
15
|
+
const formSchema = Yup.object().shape({
|
16
|
+
title: Yup.string()
|
17
|
+
.required("Required"),
|
18
|
+
});
|
19
|
+
|
20
|
+
const sections = [
|
21
|
+
{
|
22
|
+
title: "Space Details",
|
23
|
+
body: [
|
24
|
+
(<TextField label="Title" name="title" />),
|
25
|
+
],
|
26
|
+
hideTitle: false
|
27
|
+
},
|
28
|
+
]
|
29
|
+
|
30
|
+
const onCreate = (values) => {
|
31
|
+
props.saveHandler(values)
|
32
|
+
}
|
33
|
+
|
34
|
+
const cancelHandler = () => {
|
35
|
+
props.cancelHandler()
|
36
|
+
}
|
37
|
+
return (
|
38
|
+
<Container>
|
39
|
+
<ReusableForm
|
40
|
+
formTitle={props.title || "Create Space"}
|
41
|
+
initialValues={initialValues}
|
42
|
+
formSchema={formSchema}
|
43
|
+
sections={sections}
|
44
|
+
saveBtnText={props.saveBtnText || 'Create'}
|
45
|
+
cancelBtnText={props.cancelBtnText || 'Cancel'}
|
46
|
+
saveHandler={onCreate}
|
47
|
+
cancelHandler={cancelHandler}
|
48
|
+
headerStyles={{
|
49
|
+
padding: 10,
|
50
|
+
headerBackground: 'black',
|
51
|
+
titleColor: '#ffff',
|
52
|
+
}}
|
53
|
+
sectionPadding={10}
|
54
|
+
bodyRowGap={10}
|
55
|
+
{...props.formStyles}
|
56
|
+
/>
|
57
|
+
</Container>
|
58
|
+
);
|
59
|
+
};
|
60
|
+
|
61
|
+
const Container = styled.div`
|
62
|
+
|
63
|
+
`
|
64
|
+
|
65
|
+
CreateSpace.defaultProps = {};
|
66
|
+
|
67
|
+
CreateSpace.propTypes = {
|
68
|
+
title: PropTypes.string,
|
69
|
+
saveBtnText: PropTypes.string,
|
70
|
+
cancelBtnText: PropTypes.string
|
71
|
+
}
|
72
|
+
|
73
|
+
export default CreateSpace;
|
@@ -2,13 +2,21 @@ import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import styled from 'styled-components';
|
4
4
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
5
|
+
import { BsGear } from "react-icons/bs";
|
5
6
|
|
6
7
|
import Gallery from '../../Reusable Components/Gallery/Gallery';
|
7
8
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
9
|
import CreateFolder from '../CreateFolder/CreateFolder';
|
10
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
11
|
+
import Sections from '../../Sections/Sections'
|
12
|
+
import FoldersPreview from '../../PreviewComponents/FoldersPreview/FoldersPreview';
|
13
|
+
// import { Folders as Context } from '../../Pages/Library/Folders/Library.stories';
|
14
|
+
// import { ViewFolders } from './Folders.stories';
|
15
|
+
import Community from '../../Reusable Components/Community/Community';
|
9
16
|
|
10
17
|
const galleryControls = [
|
11
18
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
|
19
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
12
20
|
]
|
13
21
|
|
14
22
|
const cardControls = [
|
@@ -26,12 +34,44 @@ const Folders = ({
|
|
26
34
|
...props
|
27
35
|
}) => {
|
28
36
|
const [showModal, setShowModal] = useState(false);
|
37
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
38
|
+
const [centerContext, setCenterContext] = useState(<Folders folders={folders} />)
|
39
|
+
|
40
|
+
const formChanged = (values) => {
|
41
|
+
setCenterContext(<Folders folders={folders} {...values} />)
|
42
|
+
}
|
43
|
+
|
44
|
+
let tabs = [
|
45
|
+
{
|
46
|
+
title: 'New', id: 'preview'
|
47
|
+
},
|
48
|
+
{
|
49
|
+
title: 'Context', id: 'community'
|
50
|
+
}
|
51
|
+
]
|
52
|
+
|
53
|
+
const sections = [
|
54
|
+
{
|
55
|
+
title: 'Styles',
|
56
|
+
data: [
|
57
|
+
{
|
58
|
+
title: 'Styling', component: (<Tabs
|
59
|
+
title="Folders Config"
|
60
|
+
tabs={tabs}
|
61
|
+
/>)
|
62
|
+
}
|
63
|
+
]
|
64
|
+
}
|
65
|
+
]
|
29
66
|
|
30
67
|
const onIconClicked = (action) => {
|
31
68
|
switch (action) {
|
32
69
|
case 'add':
|
33
70
|
setShowModal(true)
|
34
71
|
break;
|
72
|
+
case 'config':
|
73
|
+
setShowConfigModal(true)
|
74
|
+
break;
|
35
75
|
default:
|
36
76
|
break;
|
37
77
|
}
|
@@ -53,13 +93,10 @@ const Folders = ({
|
|
53
93
|
return (
|
54
94
|
<Container>
|
55
95
|
<Gallery
|
56
|
-
galleryTitle="Your Folders"
|
96
|
+
galleryTitle={props.title || "Your Folders"}
|
57
97
|
data={folders}
|
58
98
|
type="flat"
|
59
99
|
cardStyle="card-style-10"
|
60
|
-
columnsNumber={columnsNumber}
|
61
|
-
galleryColumnGap={columnGap}
|
62
|
-
galleryRowGap={rowGap}
|
63
100
|
galleryControls={galleryControls}
|
64
101
|
iconClicked={onIconClicked}
|
65
102
|
cardClicked={cardClicked}
|
@@ -72,7 +109,8 @@ const Folders = ({
|
|
72
109
|
closeModal={() => setShowModal(false)}
|
73
110
|
exitModalButton={(e) => (
|
74
111
|
<div></div>
|
75
|
-
)}
|
112
|
+
)}
|
113
|
+
>
|
76
114
|
<CreateFolder
|
77
115
|
saveBtnText="Create"
|
78
116
|
cancelBtnText="Cancel"
|
@@ -80,18 +118,56 @@ const Folders = ({
|
|
80
118
|
cancelHandler={cancelHandler}
|
81
119
|
/>
|
82
120
|
</Modal>
|
121
|
+
<Modal
|
122
|
+
modalIsOpen={showConfigModal}
|
123
|
+
closeModal={() => setShowConfigModal(false)}
|
124
|
+
exitModalButton={(e) => (
|
125
|
+
<div></div>
|
126
|
+
)}
|
127
|
+
>
|
128
|
+
{/* <Sections
|
129
|
+
sections={sections}
|
130
|
+
backgroundColor={'white'}
|
131
|
+
sectionHeaderStyles={{
|
132
|
+
titleColor: 'white',
|
133
|
+
headerBackground: 'transparent'
|
134
|
+
}}
|
135
|
+
customCardStyles={{
|
136
|
+
cardPadding: 6,
|
137
|
+
cardTitleFontSize: 15,
|
138
|
+
cardBackgroundColor: '#2c2c2c',
|
139
|
+
cardTitleColor: 'white',
|
140
|
+
onHoverBackgroundColor: '#555555',
|
141
|
+
controlsStyles: {
|
142
|
+
showOnHover: true,
|
143
|
+
}
|
144
|
+
}} /> */}
|
145
|
+
<Tabs
|
146
|
+
title="Event Config"
|
147
|
+
tabs={tabs}>
|
148
|
+
<FoldersPreview
|
149
|
+
componentProps={{ folders, title: props.title || "Your Folders" }}
|
150
|
+
formChanged={formChanged}
|
151
|
+
id='preview'
|
152
|
+
/>
|
153
|
+
<Community
|
154
|
+
center={centerContext}
|
155
|
+
id="community" />
|
156
|
+
</Tabs>
|
157
|
+
</Modal>
|
83
158
|
</Container>
|
84
159
|
)
|
85
160
|
}
|
86
161
|
|
87
162
|
const Container = styled.div`
|
88
|
-
background-color:
|
163
|
+
background-color: transparent;
|
89
164
|
`
|
90
165
|
|
91
166
|
Folders.defaultProps = {};
|
92
167
|
|
93
168
|
Folders.propTypes = {
|
94
169
|
folders: PropTypes.array,
|
170
|
+
title: PropTypes.string,
|
95
171
|
folderTitle: PropTypes.string,
|
96
172
|
columnsNumber: PropTypes.number,
|
97
173
|
columnGap: PropTypes.number,
|
@@ -3,13 +3,18 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
4
4
|
|
5
5
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
6
|
+
import { BsGear } from "react-icons/bs";
|
6
7
|
import List from '../../Reusable Components/ReusableList/ReusableList';
|
7
8
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
9
|
import CreateFolder from '../CreateFolder/CreateFolder';
|
9
|
-
|
10
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
11
|
+
import Sections from '../../Sections/Sections'
|
12
|
+
import NotesPreview from '../../PreviewComponents/NotesPreview/NotesPreview';
|
13
|
+
import Community from '../../Reusable Components/Community/Community';
|
10
14
|
|
11
15
|
const listControls = [
|
12
16
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
|
17
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
13
18
|
]
|
14
19
|
|
15
20
|
const cardControls = [
|
@@ -25,12 +30,44 @@ const Notes = ({
|
|
25
30
|
...props
|
26
31
|
}) => {
|
27
32
|
const [showModal, setShowModal] = useState(false);
|
33
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
34
|
+
const [centerContext, setCenterContext] = useState(<Notes notes={notes} />)
|
35
|
+
|
36
|
+
const formChanged = (values) => {
|
37
|
+
setCenterContext(<Notes notes={notes} {...values} />)
|
38
|
+
}
|
39
|
+
|
40
|
+
let tabs = [
|
41
|
+
{
|
42
|
+
title: 'New', id: 'preview'
|
43
|
+
},
|
44
|
+
{
|
45
|
+
title: 'Context', id: 'community'
|
46
|
+
}
|
47
|
+
]
|
48
|
+
|
49
|
+
const sections = [
|
50
|
+
{
|
51
|
+
title: 'Styles',
|
52
|
+
data: [
|
53
|
+
{
|
54
|
+
title: 'Styling', component: (<Tabs
|
55
|
+
title="Notes Config"
|
56
|
+
tabs={tabs}
|
57
|
+
/>)
|
58
|
+
}
|
59
|
+
]
|
60
|
+
}
|
61
|
+
]
|
28
62
|
|
29
63
|
const onIconClicked = (action) => {
|
30
64
|
switch (action) {
|
31
65
|
case 'add':
|
32
66
|
setShowModal(true)
|
33
67
|
break;
|
68
|
+
case 'config':
|
69
|
+
setShowConfigModal(true)
|
70
|
+
break;
|
34
71
|
default:
|
35
72
|
break;
|
36
73
|
}
|
@@ -56,7 +93,7 @@ const Notes = ({
|
|
56
93
|
return (
|
57
94
|
<Container>
|
58
95
|
<List
|
59
|
-
listTitle="My Notes"
|
96
|
+
listTitle={props.title || "My Notes"}
|
60
97
|
data={notes}
|
61
98
|
type='flat'
|
62
99
|
cardStyle="card-style-11"
|
@@ -74,12 +111,31 @@ const Notes = ({
|
|
74
111
|
<div></div>
|
75
112
|
)}>
|
76
113
|
<CreateFolder
|
77
|
-
saveBtnText="Create"
|
78
|
-
cancelBtnText="Cancel"
|
114
|
+
saveBtnText={props.saveBtnText || "Create"}
|
115
|
+
cancelBtnText={props.cancelBtnText || "Cancel"}
|
79
116
|
saveHandler={onAddFolder}
|
80
117
|
cancelHandler={cancelHandler}
|
81
118
|
/>
|
82
119
|
</Modal>
|
120
|
+
<Modal
|
121
|
+
modalIsOpen={showConfigModal}
|
122
|
+
closeModal={() => setShowConfigModal(false)}
|
123
|
+
exitModalButton={(e) => (
|
124
|
+
<div></div>
|
125
|
+
)}
|
126
|
+
>
|
127
|
+
<Tabs
|
128
|
+
title="Event Config"
|
129
|
+
tabs={tabs}>
|
130
|
+
<NotesPreview
|
131
|
+
componentProps={{ notes, title: props.title || "Your Notes" }}
|
132
|
+
formChanged={formChanged }
|
133
|
+
/>
|
134
|
+
<Community
|
135
|
+
center={centerContext}
|
136
|
+
id="community" />
|
137
|
+
</Tabs>
|
138
|
+
</Modal>
|
83
139
|
</Container>
|
84
140
|
)
|
85
141
|
}
|
@@ -95,7 +151,11 @@ Notes.propTypes = {
|
|
95
151
|
iconColor: PropTypes.string,
|
96
152
|
cardTitleFontSize: PropTypes.number,
|
97
153
|
cardTitleColor: PropTypes.string,
|
98
|
-
cardPadding: PropTypes.number
|
154
|
+
cardPadding: PropTypes.number,
|
155
|
+
saveBtnText: PropTypes.string,
|
156
|
+
cancelBtnText: PropTypes.string,
|
157
|
+
headerStyles: PropTypes.object,
|
158
|
+
customCardStyles: PropTypes.object
|
99
159
|
}
|
100
160
|
|
101
161
|
export default Notes;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
4
|
+
|
5
|
+
import NavbarPreview from '../../PreviewComponents/NavbarPreview/NavbarPreview';
|
6
|
+
import Button from '../../Buttons/Buttons/Buttons';
|
7
|
+
|
8
|
+
const SectionedPreview = () => {
|
9
|
+
const [showModal, setShowModal] = useState(false);
|
10
|
+
return (
|
11
|
+
<Container>
|
12
|
+
<Button
|
13
|
+
label={'Open Configurator'}
|
14
|
+
size="md"
|
15
|
+
variant="primary"
|
16
|
+
buttonClicked={() => { setShowModal(true) }}
|
17
|
+
/>
|
18
|
+
<Modal
|
19
|
+
modalIsOpen={showModal}
|
20
|
+
closeModal={() => setShowModal(false)}>
|
21
|
+
<NavbarPreview />
|
22
|
+
</Modal>
|
23
|
+
</Container>
|
24
|
+
);
|
25
|
+
};
|
26
|
+
|
27
|
+
const Container = styled.div`
|
28
|
+
|
29
|
+
`
|
30
|
+
|
31
|
+
export default SectionedPreview;
|