@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.
- package/dist/stories/Chat/Chat.js +129 -14
- 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 +116 -5
- package/dist/stories/Events/EventsList/EventsList.js +94 -19
- package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
- package/dist/stories/Library/Folders/Folders.js +77 -5
- 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 +137 -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/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 +75 -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/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 +81 -5
- 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 +1 -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
@@ -26,12 +26,12 @@ import img6 from '../../../assets/images/music6.jpg';
|
|
26
26
|
const Music = (props) => {
|
27
27
|
const [currentSong, setCurrentSong] = useState(0)
|
28
28
|
const [album, setAlbum] = useState([
|
29
|
-
{ index: 0, cover: img4, musicSrc: 'https://www.pacdv.com/sounds/free-music/
|
29
|
+
{ index: 0, cover: img4, musicSrc: 'https://www.pacdv.com/sounds/free-music/gentle-thoughts-1.mp3', title: 'Plans We Made', description: 'Son Lux', time: '5:20' },
|
30
30
|
{ index: 2, cover: img6, musicSrc: 'https://www.pacdv.com/sounds/free-music/kickstarter.mp3', title: 'Still Loving You', description: 'Scorpions', time: '4:20' },
|
31
|
-
{ index: 1, cover: img5, musicSrc: 'https://www.pacdv.com/sounds/free-music/
|
31
|
+
{ index: 1, cover: img5, musicSrc: 'https://www.pacdv.com/sounds/free-music/glow-in-the-dark.mp3', title: 'Night', description: 'Frank Ocean', time: '5:20' },
|
32
32
|
{ index: 3, cover: img1, musicSrc: 'https://www.pacdv.com/sounds/free-music/kickstarter.mp3', title: 'Somebody Else', description: '1975', time: '5:20' },
|
33
|
-
{ index: 4, cover: img3, musicSrc: 'https://www.pacdv.com/sounds/free-music/
|
34
|
-
{ index: 5, cover: img2, musicSrc: 'https://www.pacdv.com/sounds/free-music/
|
33
|
+
{ index: 4, cover: img3, musicSrc: 'https://www.pacdv.com/sounds/free-music/gentle-thoughts-1.mp3', title: 'Enter Sandman', description: 'Metallica', time: '5:20' },
|
34
|
+
{ index: 5, cover: img2, musicSrc: 'https://www.pacdv.com/sounds/free-music/glow-in-the-dark.mp3', title: 'November Rain', description: "Guns N' Roses", time: '5:20' },
|
35
35
|
])
|
36
36
|
|
37
37
|
const nextSong = () => {
|
@@ -133,8 +133,9 @@ const Music = (props) => {
|
|
133
133
|
}
|
134
134
|
}}
|
135
135
|
customCardStyles={{
|
136
|
+
cardBackgroundColor: 'white',
|
136
137
|
controlsStyles: {
|
137
|
-
iconColor: '
|
138
|
+
iconColor: 'black'
|
138
139
|
}
|
139
140
|
}}
|
140
141
|
/>
|
@@ -155,7 +156,8 @@ const Music = (props) => {
|
|
155
156
|
prevSong: prevSong,
|
156
157
|
currentSong: currentSong,
|
157
158
|
borderRadius: '10',
|
158
|
-
primaryColor: 'black'
|
159
|
+
primaryColor: 'black',
|
160
|
+
backgroundColor: 'white'
|
159
161
|
}}
|
160
162
|
headerStyles={{
|
161
163
|
controlsStyles: {
|
@@ -99,9 +99,6 @@ const MusicAlbums = (props) => {
|
|
99
99
|
cardBackgroundColor: 'black',
|
100
100
|
cardTitleColor: 'white',
|
101
101
|
onHoverBackgroundColor: '#F6891F',
|
102
|
-
controlsStyles: {
|
103
|
-
showOnHover: true,
|
104
|
-
}
|
105
102
|
},
|
106
103
|
}}
|
107
104
|
/>
|
@@ -127,16 +124,6 @@ const MusicAlbums = (props) => {
|
|
127
124
|
}}
|
128
125
|
customCardStyles={{
|
129
126
|
darkOnHover: true,
|
130
|
-
controlsStyles: {
|
131
|
-
showOnHover: true,
|
132
|
-
position: 'center',
|
133
|
-
dropdownFontColor: "white",
|
134
|
-
iconBorderRadius: 100,
|
135
|
-
iconSize: 40,
|
136
|
-
iconsGap: 10,
|
137
|
-
iconColor: 'white',
|
138
|
-
containerPadding: 20,
|
139
|
-
}
|
140
127
|
}}
|
141
128
|
cardClicked={cardClicked}
|
142
129
|
/>
|
@@ -6,10 +6,19 @@ import AddPhoto from '../../Forms/AddPhoto/AddPhoto'
|
|
6
6
|
import Gallery from '../../Reusable Components/Gallery/Gallery';
|
7
7
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
8
|
import DetailedPhoto from '../DetailedPhoto/DetailedPhoto';
|
9
|
+
import PhotoAlbumPreview from '../../PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview';
|
10
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
11
|
+
import Sections from '../../Sections/Sections';
|
12
|
+
import Community from '../../Reusable Components/Community/Community';
|
13
|
+
|
14
|
+
|
9
15
|
import { AiOutlineArrowLeft, AiOutlineArrowRight, AiOutlineClose, AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
16
|
+
import { BsGear } from "react-icons/bs";
|
17
|
+
|
10
18
|
|
11
19
|
const galleryControls = [
|
12
20
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
|
21
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
13
22
|
]
|
14
23
|
|
15
24
|
const cardControls = [
|
@@ -20,9 +29,6 @@ const ViewAlbum = ({
|
|
20
29
|
album,
|
21
30
|
cardBackgroundColor,
|
22
31
|
imgTitleColor,
|
23
|
-
columnsNumber,
|
24
|
-
columnGap,
|
25
|
-
rowGap,
|
26
32
|
descColor,
|
27
33
|
...props
|
28
34
|
}) => {
|
@@ -49,10 +55,27 @@ const ViewAlbum = ({
|
|
49
55
|
}
|
50
56
|
}
|
51
57
|
|
52
|
-
const [showModal, setShowModal] = useState(false)
|
53
|
-
const [
|
58
|
+
const [showModal, setShowModal] = useState(false);
|
59
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
60
|
+
const [showImgModal, setShowImgModal] = useState(false);
|
54
61
|
const [openedImgIndex, setOpenedImgIndex] = useState(null);
|
55
|
-
const [openedImg, setOpenedImg] = useState(null)
|
62
|
+
const [openedImg, setOpenedImg] = useState(null);
|
63
|
+
|
64
|
+
const [centerContext, setCenterContext] = useState(<ViewAlbum album={album} />)
|
65
|
+
|
66
|
+
const formChanged = (values) => {
|
67
|
+
setCenterContext(<ViewAlbum album={album} {...values} />)
|
68
|
+
}
|
69
|
+
|
70
|
+
let tabs = [
|
71
|
+
{
|
72
|
+
title: 'New', id: 'preview'
|
73
|
+
},
|
74
|
+
{
|
75
|
+
title: 'Context', id: 'community'
|
76
|
+
}
|
77
|
+
]
|
78
|
+
|
56
79
|
|
57
80
|
const handleUserKeyPress = useCallback(event => {
|
58
81
|
const { key } = event;
|
@@ -73,13 +96,18 @@ const ViewAlbum = ({
|
|
73
96
|
case 'add':
|
74
97
|
setShowModal(true)
|
75
98
|
break;
|
99
|
+
case 'config':
|
100
|
+
setShowConfigModal(true)
|
101
|
+
break;
|
76
102
|
default:
|
77
103
|
break;
|
78
104
|
}
|
79
105
|
}
|
80
106
|
|
81
107
|
const cardIconClicked = (action, index) => {
|
82
|
-
props.
|
108
|
+
if (!props.preview) {
|
109
|
+
props.cardIconClicked(action, index)
|
110
|
+
}
|
83
111
|
}
|
84
112
|
|
85
113
|
const onAddPhoto = (photo) => {
|
@@ -111,13 +139,10 @@ const ViewAlbum = ({
|
|
111
139
|
return (
|
112
140
|
<Container>
|
113
141
|
<Gallery
|
114
|
-
galleryTitle="Photo Album"
|
142
|
+
galleryTitle={props.title || "Photo Album"}
|
115
143
|
data={album}
|
116
144
|
type="flat"
|
117
145
|
cardStyle="card-style-6"
|
118
|
-
columnsNumber={columnsNumber}
|
119
|
-
galleryColumnGap={columnGap}
|
120
|
-
galleryRowGap={rowGap}
|
121
146
|
galleryControls={galleryControls}
|
122
147
|
iconClicked={onIconClicked}
|
123
148
|
cardClicked={cardClicked}
|
@@ -135,8 +160,8 @@ const ViewAlbum = ({
|
|
135
160
|
<AddPhoto
|
136
161
|
saveHandler={onAddPhoto}
|
137
162
|
cancelHandler={cancelHandler}
|
138
|
-
saveBtnText={'Add'}
|
139
|
-
cancelBtnText={'Cancel'} />
|
163
|
+
saveBtnText={props.saveBtnText || 'Add'}
|
164
|
+
cancelBtnText={props.saveBtnText || 'Cancel'} />
|
140
165
|
</Modal>
|
141
166
|
<Modal
|
142
167
|
modalIsOpen={showImgModal}
|
@@ -160,6 +185,27 @@ const ViewAlbum = ({
|
|
160
185
|
<AiOutlineArrowRight />
|
161
186
|
</RightIconContainer>
|
162
187
|
</Modal>
|
188
|
+
<Modal
|
189
|
+
modalIsOpen={showConfigModal}
|
190
|
+
closeModal={() => setShowConfigModal(false)}
|
191
|
+
exitModalButton={(e) => (
|
192
|
+
<div></div>
|
193
|
+
)}
|
194
|
+
>
|
195
|
+
<Tabs
|
196
|
+
title="Photo Album Config"
|
197
|
+
tabs={tabs}
|
198
|
+
id='styling'
|
199
|
+
>
|
200
|
+
<PhotoAlbumPreview
|
201
|
+
componentProps={{ album, title: props.title || 'Photo Album', preview: true }}
|
202
|
+
formChanged={formChanged}
|
203
|
+
/>
|
204
|
+
<Community
|
205
|
+
center={centerContext}
|
206
|
+
id="community" />
|
207
|
+
</Tabs>
|
208
|
+
</Modal>
|
163
209
|
</Container>
|
164
210
|
)
|
165
211
|
}
|
@@ -237,6 +283,10 @@ ViewAlbum.propTypes = {
|
|
237
283
|
cardBackgroundColor: PropTypes.string,
|
238
284
|
imgTitleColor: PropTypes.string,
|
239
285
|
descColor: PropTypes.string,
|
286
|
+
title: PropTypes.string,
|
287
|
+
saveBtnText: PropTypes.string,
|
288
|
+
saveBtnText: PropTypes.string,
|
289
|
+
preview: PropTypes.bool
|
240
290
|
}
|
241
291
|
|
242
292
|
export default ViewAlbum;
|
@@ -5,8 +5,13 @@ import PropTypes from 'prop-types';
|
|
5
5
|
import CreateAlbum from '../../Forms/CreateAlbum/CreateAlbum'
|
6
6
|
import Gallery from '../../Reusable Components/Gallery/Gallery';
|
7
7
|
import Modal from '../../Reusable Components/ReactModal/ReactModal';
|
8
|
+
import PhotoAlbumsPreview from '../../PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview';
|
9
|
+
import Tabs from '../../Reusable Components/Tabs/Tabs';
|
10
|
+
import Sections from '../../Sections/Sections';
|
11
|
+
import Community from '../../Reusable Components/Community/Community';
|
8
12
|
|
9
13
|
import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
|
14
|
+
import { BsGear } from "react-icons/bs";
|
10
15
|
|
11
16
|
const cardControls = [
|
12
17
|
{ icon: (<AiFillDelete />), action: 'delete', name: 'Delete album' },
|
@@ -14,29 +19,51 @@ const cardControls = [
|
|
14
19
|
|
15
20
|
const galleryControls = [
|
16
21
|
{ icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
|
22
|
+
{ icon: (<BsGear />), action: 'config', name: 'Config' },
|
17
23
|
]
|
18
24
|
|
19
25
|
const ViewAlbums = ({
|
20
26
|
albums,
|
21
|
-
columnsNumber,
|
22
|
-
columnGap,
|
23
|
-
rowGap,
|
24
27
|
...props }) => {
|
25
28
|
|
26
|
-
const [showModal, setShowModal] = useState(false)
|
29
|
+
const [showModal, setShowModal] = useState(false);
|
30
|
+
const [showConfigModal, setShowConfigModal] = useState(false);
|
31
|
+
const [centerContext, setCenterContext] = useState(<ViewAlbums albums={albums} />)
|
32
|
+
|
33
|
+
const formChanged = (values) => {
|
34
|
+
setCenterContext(<ViewAlbums albums={albums} {...values} />)
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
let tabs = [
|
39
|
+
{
|
40
|
+
title: 'New', id: 'preview'
|
41
|
+
},
|
42
|
+
{
|
43
|
+
title: 'Context', id: 'community'
|
44
|
+
}
|
45
|
+
]
|
46
|
+
|
27
47
|
|
28
48
|
const onIconClicked = (action) => {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
49
|
+
if (!props.preview) {
|
50
|
+
switch (action) {
|
51
|
+
case 'add':
|
52
|
+
setShowModal(true)
|
53
|
+
break;
|
54
|
+
case 'config':
|
55
|
+
setShowConfigModal(true)
|
56
|
+
break;
|
57
|
+
default:
|
58
|
+
break;
|
59
|
+
}
|
35
60
|
}
|
36
61
|
}
|
37
62
|
|
38
63
|
const cardIconClicked = (action, index) => {
|
39
|
-
props.
|
64
|
+
if (!props.preview) {
|
65
|
+
props.cardIconClicked(action, index)
|
66
|
+
}
|
40
67
|
}
|
41
68
|
|
42
69
|
const onAddAlbum = (album) => {
|
@@ -51,13 +78,10 @@ const ViewAlbums = ({
|
|
51
78
|
return (
|
52
79
|
<Container>
|
53
80
|
<Gallery
|
54
|
-
galleryTitle="Photo Albums"
|
81
|
+
galleryTitle={props.title || "Photo Albums"}
|
55
82
|
data={albums}
|
56
83
|
type="flat"
|
57
84
|
cardStyle="card-style-6"
|
58
|
-
columnsNumber={columnsNumber}
|
59
|
-
galleryColumnGap={columnGap}
|
60
|
-
galleryRowGap={rowGap}
|
61
85
|
galleryControls={galleryControls}
|
62
86
|
iconClicked={onIconClicked}
|
63
87
|
cardControls={cardControls}
|
@@ -74,6 +98,28 @@ const ViewAlbums = ({
|
|
74
98
|
saveHandler={onAddAlbum}
|
75
99
|
cancelHandler={cancelHandler} />
|
76
100
|
</Modal>
|
101
|
+
<Modal
|
102
|
+
modalIsOpen={showConfigModal}
|
103
|
+
closeModal={() => setShowConfigModal(false)}
|
104
|
+
exitModalButton={(e) => (
|
105
|
+
<div></div>
|
106
|
+
)}
|
107
|
+
>
|
108
|
+
<Tabs
|
109
|
+
title="Photo Albums Config"
|
110
|
+
tabs={tabs}
|
111
|
+
id='styling'
|
112
|
+
>
|
113
|
+
<PhotoAlbumsPreview
|
114
|
+
componentProps={{ albums, title: props.title || 'Photo Albums', preview: true }}
|
115
|
+
formChanged={formChanged}
|
116
|
+
id='preview'
|
117
|
+
/>
|
118
|
+
<Community
|
119
|
+
center={centerContext}
|
120
|
+
id="community" />
|
121
|
+
</Tabs>
|
122
|
+
</Modal>
|
77
123
|
</Container>
|
78
124
|
)
|
79
125
|
}
|
@@ -82,30 +128,17 @@ const Container = styled.div`
|
|
82
128
|
width: 100%;
|
83
129
|
`
|
84
130
|
|
85
|
-
ViewAlbums.defaultProps = {
|
86
|
-
columnsNumber: 3,
|
87
|
-
headerBackground: '#FE1744',
|
88
|
-
titleColor: 'white',
|
89
|
-
cardBackgroundColor: 'white',
|
90
|
-
columnGap: 10,
|
91
|
-
rowGap: 20
|
92
|
-
};
|
131
|
+
ViewAlbums.defaultProps = {};
|
93
132
|
|
94
133
|
ViewAlbums.propTypes = {
|
95
134
|
albums: PropTypes.array,
|
96
135
|
cardIconClicked: PropTypes.func,
|
97
136
|
onDeleteAlbum: PropTypes.func,
|
98
137
|
onAddAlbum: PropTypes.func,
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
columnGap: PropTypes.number,
|
104
|
-
rowGap: PropTypes.number,
|
105
|
-
countColor: PropTypes.string,
|
106
|
-
countFontSize: PropTypes.number,
|
107
|
-
cardTitleColor: PropTypes.string,
|
108
|
-
cardTitleFontSize: PropTypes.number,
|
138
|
+
title: PropTypes.string,
|
139
|
+
headerStyles: PropTypes.object,
|
140
|
+
customCardStyles: PropTypes.object,
|
141
|
+
preview: PropTypes.bool
|
109
142
|
}
|
110
143
|
|
111
144
|
export default ViewAlbums
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
|
5
|
+
import { getComponentType } from '../helpers/util';
|
6
|
+
|
7
|
+
const Preview = ({
|
8
|
+
type,
|
9
|
+
componentProps,
|
10
|
+
stylingProps,
|
11
|
+
...props
|
12
|
+
}) => {
|
13
|
+
|
14
|
+
const child = getComponentType(type, componentProps, stylingProps);
|
15
|
+
|
16
|
+
return (
|
17
|
+
<Container>
|
18
|
+
{child}
|
19
|
+
</Container>
|
20
|
+
)
|
21
|
+
};
|
22
|
+
|
23
|
+
const Container = styled.div`
|
24
|
+
width: 100%;
|
25
|
+
`
|
26
|
+
|
27
|
+
Preview.defaultProps = {};
|
28
|
+
|
29
|
+
Preview.propTypes = {
|
30
|
+
type: PropTypes.string,
|
31
|
+
componentProps: PropTypes.object,
|
32
|
+
stylingProps: PropTypes.object
|
33
|
+
}
|
34
|
+
|
35
|
+
export default Preview;
|
@@ -0,0 +1,132 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import Preview from '../../Preview/Preview';
|
4
|
+
import ReusableForm from '../../Reusable Components/ReusableForm/ReusableForm';
|
5
|
+
|
6
|
+
import { Container, Left, Right } from '../globalStyles';
|
7
|
+
import Picker from '../../Common Inputs/Picker/Picker';
|
8
|
+
import TextField from '../../Common Inputs/TextField/TextField';
|
9
|
+
|
10
|
+
|
11
|
+
const ChatPreview = (props) => {
|
12
|
+
const [chatStyles, setChatStyles] = useState({});
|
13
|
+
const initialValues = {
|
14
|
+
headerStyles: {
|
15
|
+
headerBackground: '',
|
16
|
+
padding: 0,
|
17
|
+
titleColor: '',
|
18
|
+
titleFontSize: '',
|
19
|
+
titleFontWeight: '',
|
20
|
+
controlsStyles: {
|
21
|
+
iconSize: '',
|
22
|
+
iconColor: ''
|
23
|
+
}
|
24
|
+
},
|
25
|
+
customCardStyles: {
|
26
|
+
cardBackgroundColor: '',
|
27
|
+
onHoverBackgroundColor: '',
|
28
|
+
cardRadius: '',
|
29
|
+
cardTitleFontSize: '',
|
30
|
+
cardTitleFontWeight: '',
|
31
|
+
cardTitleColor: '',
|
32
|
+
cardImageRadius: '',
|
33
|
+
cardDescriptionFontSize: '',
|
34
|
+
cardDescriptionColor: '',
|
35
|
+
cardPadding: 0,
|
36
|
+
imgSize: 0,
|
37
|
+
cardBorderSize: 0,
|
38
|
+
cardBorderColor: 'purple',
|
39
|
+
dateColor: ''
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
const sections = [
|
44
|
+
{
|
45
|
+
title: "Header Styles",
|
46
|
+
body: [
|
47
|
+
(<Picker label="Header Background" name="headerStyles.headerBackground" />),
|
48
|
+
(<TextField type="number" label="Padding" name="headerStyles.padding" />),
|
49
|
+
(<Picker label="Title Color" name="headerStyles.titleColor" />),
|
50
|
+
(<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
|
51
|
+
(<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
|
52
|
+
(<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
|
53
|
+
(<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
|
54
|
+
]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
title: "Card Styles",
|
58
|
+
body: [
|
59
|
+
(<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
|
60
|
+
(<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
|
61
|
+
(<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
|
62
|
+
(<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
|
63
|
+
(<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
|
64
|
+
(<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
|
65
|
+
(<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
|
66
|
+
(<TextField type="number" label="Text Font Size" name="customCardStyles.cardDescriptionFontSize" />),
|
67
|
+
(<Picker label="Text Font Color" name="customCardStyles.cardDescriptionColor" />),
|
68
|
+
(<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
|
69
|
+
(<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
|
70
|
+
(<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
|
71
|
+
(<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
|
72
|
+
(<Picker label="Date Color" name="customCardStyles.dateColor" />),
|
73
|
+
]
|
74
|
+
},
|
75
|
+
]
|
76
|
+
|
77
|
+
const handleChange = (values) => {
|
78
|
+
if(values){
|
79
|
+
props.formChanged(values)
|
80
|
+
setChatStyles(values)
|
81
|
+
localStorage.setItem('formStyles', JSON.stringify(values))
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
const submitHandler = (values) => {
|
86
|
+
console.log(values);
|
87
|
+
}
|
88
|
+
|
89
|
+
const cancelHandler = () => {
|
90
|
+
console.log('Canceled')
|
91
|
+
}
|
92
|
+
return (
|
93
|
+
<Container>
|
94
|
+
<Left>
|
95
|
+
<ReusableForm
|
96
|
+
formTitle="Chat Styles"
|
97
|
+
initialValues={initialValues}
|
98
|
+
sections={sections}
|
99
|
+
headerStyles={{
|
100
|
+
padding: 10,
|
101
|
+
headerBackground: 'black',
|
102
|
+
titleColor: '#ffff',
|
103
|
+
}}
|
104
|
+
sectionHeaderStyles={{
|
105
|
+
padding: 6,
|
106
|
+
headerBackground: '#FE1744',
|
107
|
+
titleColor: '#ffff',
|
108
|
+
}}
|
109
|
+
bodyPadding={10}
|
110
|
+
saveBtnText="Save"
|
111
|
+
cancelBtnText="Cancel"
|
112
|
+
saveBtnHandle={submitHandler}
|
113
|
+
cancelHandler={cancelHandler}
|
114
|
+
handleChange={handleChange}
|
115
|
+
bodyRowGap={20}
|
116
|
+
bodyColumnGap={10}
|
117
|
+
/>
|
118
|
+
</Left>
|
119
|
+
<Right>
|
120
|
+
<Preview type={'Chat'} componentProps={props.componentProps} stylingProps={chatStyles} />
|
121
|
+
</Right>
|
122
|
+
</Container>
|
123
|
+
);
|
124
|
+
};
|
125
|
+
|
126
|
+
ChatPreview.defaultProps = {};
|
127
|
+
|
128
|
+
ChatPreview.propTypes = {
|
129
|
+
componentProps: PropTypes.object
|
130
|
+
}
|
131
|
+
|
132
|
+
export default ChatPreview;
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import Preview from '../../Preview/Preview';
|
4
|
+
import ReusableForm from '../../Reusable Components/ReusableForm/ReusableForm';
|
5
|
+
|
6
|
+
import { Container, Left, Right } from '../globalStyles';
|
7
|
+
import Picker from '../../Common Inputs/Picker/Picker';
|
8
|
+
import TextField from '../../Common Inputs/TextField/TextField';
|
9
|
+
|
10
|
+
const EventPreview = (props) => {
|
11
|
+
const [eventStyles, setEventStyles] = useState({});
|
12
|
+
const initialValues = {
|
13
|
+
headerStyles: {
|
14
|
+
headerBackground: '',
|
15
|
+
padding: 0,
|
16
|
+
titleColor: '',
|
17
|
+
titleFontSize: '',
|
18
|
+
titleFontWeight: '',
|
19
|
+
controlsStyles: {
|
20
|
+
iconSize: '',
|
21
|
+
iconColor: ''
|
22
|
+
}
|
23
|
+
},
|
24
|
+
backgroundColor: '',
|
25
|
+
titleColor: '',
|
26
|
+
titleSize: '',
|
27
|
+
dateColor: '',
|
28
|
+
dateSize: '',
|
29
|
+
discColor: '',
|
30
|
+
discSize: '',
|
31
|
+
}
|
32
|
+
|
33
|
+
const sections = [
|
34
|
+
{
|
35
|
+
title: "Header Styles",
|
36
|
+
body: [
|
37
|
+
(<Picker label="Header Background" name="headerStyles.headerBackground" />),
|
38
|
+
(<TextField type="number" label="Padding" name="headerStyles.padding" />),
|
39
|
+
(<Picker label="Title Color" name="headerStyles.titleColor" />),
|
40
|
+
(<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
|
41
|
+
(<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
|
42
|
+
(<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
|
43
|
+
(<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
|
44
|
+
]
|
45
|
+
},
|
46
|
+
{
|
47
|
+
title: "Event Styles",
|
48
|
+
body: [
|
49
|
+
(<Picker label="Background Color" name="backgroundColor" />),
|
50
|
+
(<Picker label="Title Color" name="titleColor" />),
|
51
|
+
(<TextField type="number" label="Title Size" name="titleSize" />),
|
52
|
+
(<Picker label="Date Color" name="dateColor" />),
|
53
|
+
(<TextField type="number" label="Date Size" name="dateSize" />),
|
54
|
+
(<Picker label="Discription Color" name="discColor" />),
|
55
|
+
(<TextField type="number" label="Discription Size" name="discSize" />),
|
56
|
+
]
|
57
|
+
},
|
58
|
+
]
|
59
|
+
|
60
|
+
const handleChange = (values) => {
|
61
|
+
if(values){
|
62
|
+
props.formChanged(values)
|
63
|
+
setEventStyles(values)
|
64
|
+
localStorage.setItem('formStyles', JSON.stringify(values))
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
const submitHandler = (values) => {
|
69
|
+
console.log(values);
|
70
|
+
}
|
71
|
+
|
72
|
+
const cancelHandler = () => {
|
73
|
+
console.log('Canceled')
|
74
|
+
}
|
75
|
+
|
76
|
+
return (
|
77
|
+
<Container>
|
78
|
+
<Left>
|
79
|
+
<ReusableForm
|
80
|
+
formTitle="Events Styles"
|
81
|
+
initialValues={initialValues}
|
82
|
+
sections={sections}
|
83
|
+
headerStyles={{
|
84
|
+
padding: 10,
|
85
|
+
headerBackground: 'black',
|
86
|
+
titleColor: '#ffff',
|
87
|
+
}}
|
88
|
+
sectionHeaderStyles={{
|
89
|
+
padding: 6,
|
90
|
+
headerBackground: '#FE1744',
|
91
|
+
titleColor: '#ffff',
|
92
|
+
}}
|
93
|
+
bodyPadding={10}
|
94
|
+
saveBtnText="Save"
|
95
|
+
cancelBtnText="Cancel"
|
96
|
+
saveBtnHandle={submitHandler}
|
97
|
+
cancelHandler={cancelHandler}
|
98
|
+
handleChange={handleChange}
|
99
|
+
bodyRowGap={20}
|
100
|
+
bodyColumnGap={10}
|
101
|
+
/>
|
102
|
+
</Left>
|
103
|
+
<Right>
|
104
|
+
<Preview type={'Event'} componentProps={props.componentProps} stylingProps={eventStyles} />
|
105
|
+
</Right>
|
106
|
+
</Container>
|
107
|
+
);
|
108
|
+
};
|
109
|
+
|
110
|
+
EventPreview.defaultProps = {};
|
111
|
+
|
112
|
+
EventPreview.propTypes = {
|
113
|
+
componentProps: PropTypes.object
|
114
|
+
}
|
115
|
+
|
116
|
+
export default EventPreview;
|