@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.
Files changed (147) hide show
  1. package/dist/stories/Chat/Chat.js +127 -33
  2. package/dist/stories/Common Inputs/EditorComponent/EditorComponent.js +4 -2
  3. package/dist/stories/Common Inputs/Picker/Picker.js +61 -0
  4. package/dist/stories/Common Inputs/TextField/TextField.js +3 -1
  5. package/dist/stories/Community/Community.js +137 -0
  6. package/dist/stories/Enrollment/Admin/CreateForm/CreateForm.js +1 -1
  7. package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.js +11 -23
  8. package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +2 -17
  9. package/dist/stories/Enrollment/Guest/FillForm/FillForm.js +4 -17
  10. package/dist/stories/Events/Event/Event.js +117 -5
  11. package/dist/stories/Events/EventsList/EventsList.js +98 -19
  12. package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
  13. package/dist/stories/Library/Folders/Folders.js +82 -7
  14. package/dist/stories/Library/Notes/Notes.js +78 -4
  15. package/dist/stories/Library/ViewNote/ViewNote.js +7 -10
  16. package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
  17. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +139 -23
  18. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +70 -34
  19. package/dist/stories/Navbar/Navbar.js +15 -45
  20. package/dist/stories/Pages/Chat/Chat.js +13 -1
  21. package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +19 -1
  22. package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +7 -1
  23. package/dist/stories/Pages/Enrollment/Forms/Forms.js +24 -2
  24. package/dist/stories/Pages/Events/Event/Event.js +14 -5
  25. package/dist/stories/Pages/Events/Events/Events.js +1 -0
  26. package/dist/stories/Pages/Library/Folders/Library.js +7 -1
  27. package/dist/stories/Pages/Music/MusicAlbum/Music.js +12 -5
  28. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +34 -5
  29. package/dist/stories/Pages/Photos/Album/Album.js +7 -1
  30. package/dist/stories/Pages/Photos/Albums/Albums.js +38 -2
  31. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +80 -27
  32. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +85 -60
  33. package/dist/stories/Preview/Preview.js +37 -0
  34. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +193 -0
  35. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +158 -0
  36. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +192 -0
  37. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +182 -0
  38. package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +177 -0
  39. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +181 -0
  40. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +153 -0
  41. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +112 -0
  42. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +173 -0
  43. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +189 -0
  44. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +189 -0
  45. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +197 -0
  46. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +189 -0
  47. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +175 -0
  48. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +172 -0
  49. package/dist/stories/PreviewComponents/globalStyles.js +26 -0
  50. package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +10 -5
  51. package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +8 -4
  52. package/dist/stories/Reusable Components/Cards/Card-style-3/CardStyle3.js +3 -2
  53. package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.js +10 -4
  54. package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.js +4 -2
  55. package/dist/stories/Reusable Components/Cards/Card-style-9/CardStyle9.js +26 -15
  56. package/dist/stories/Reusable Components/Cards/globalCardStyles.js +3 -3
  57. package/dist/stories/Reusable Components/Community/Community.js +76 -0
  58. package/dist/stories/Reusable Components/Gallery/Gallery.js +17 -18
  59. package/dist/stories/Reusable Components/ReactModal/ReactModal.js +11 -30
  60. package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +20 -3
  61. package/dist/stories/Reusable Components/ReusableList/ReusableList.js +15 -9
  62. package/dist/stories/Reusable Components/Tabs/Tabs.js +68 -0
  63. package/dist/stories/Sections/Sections.js +67 -0
  64. package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +77 -18
  65. package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +96 -3
  66. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +78 -5
  67. package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +17 -11
  68. package/dist/stories/Widgets/SpacesListWidget/SpacesListWidget.js +115 -0
  69. package/dist/stories/Widgets/UsersWidget/UsersWidget.js +30 -0
  70. package/dist/stories/helpers/util.js +70 -7
  71. package/dist/stories/store/communities.js +943 -0
  72. package/dist/stories/store/store.js +44 -0
  73. package/package.json +5 -2
  74. package/src/stories/Chat/Chat.jsx +109 -35
  75. package/src/stories/Common Inputs/EditorComponent/EditorComponent.jsx +3 -3
  76. package/src/stories/Common Inputs/Picker/Picker.jsx +47 -0
  77. package/src/stories/Common Inputs/TextField/TextField.jsx +1 -1
  78. package/src/stories/Community/Community.jsx +110 -0
  79. package/src/stories/Enrollment/Admin/CreateForm/CreateForm.jsx +1 -0
  80. package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.jsx +8 -19
  81. package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +3 -17
  82. package/src/stories/Enrollment/Guest/FillForm/FillForm.jsx +6 -16
  83. package/src/stories/Events/Event/Event.jsx +98 -5
  84. package/src/stories/Events/EventsList/EventsList.jsx +101 -22
  85. package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
  86. package/src/stories/Library/Folders/Folders.jsx +82 -8
  87. package/src/stories/Library/Notes/Notes.jsx +65 -5
  88. package/src/stories/Library/ViewNote/ViewNote.jsx +1 -12
  89. package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
  90. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +133 -21
  91. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +62 -36
  92. package/src/stories/Navbar/Navbar.jsx +51 -49
  93. package/src/stories/Pages/Chat/Chat.jsx +17 -4
  94. package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +20 -1
  95. package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +6 -0
  96. package/src/stories/Pages/Enrollment/Forms/Forms.jsx +23 -1
  97. package/src/stories/Pages/Events/Event/Event.jsx +12 -4
  98. package/src/stories/Pages/Events/Events/Events.jsx +75 -74
  99. package/src/stories/Pages/Library/Folders/Library.jsx +7 -1
  100. package/src/stories/Pages/Music/MusicAlbum/Music.jsx +16 -8
  101. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +28 -27
  102. package/src/stories/Pages/Photos/Album/Album.jsx +7 -1
  103. package/src/stories/Pages/Photos/Albums/Albums.jsx +25 -20
  104. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +63 -21
  105. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +65 -66
  106. package/src/stories/Preview/Preview.jsx +35 -0
  107. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +132 -0
  108. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +116 -0
  109. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +132 -0
  110. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +127 -0
  111. package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +124 -0
  112. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +126 -0
  113. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +113 -0
  114. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +93 -0
  115. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +122 -0
  116. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +129 -0
  117. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +129 -0
  118. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +138 -0
  119. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +129 -0
  120. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +124 -0
  121. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +125 -0
  122. package/src/stories/PreviewComponents/globalStyles.js +20 -0
  123. package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +13 -6
  124. package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -5
  125. package/src/stories/Reusable Components/Cards/Card-style-3/CardStyle3.jsx +5 -2
  126. package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.jsx +12 -6
  127. package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.jsx +2 -2
  128. package/src/stories/Reusable Components/Cards/Card-style-9/CardStyle9.jsx +12 -8
  129. package/src/stories/Reusable Components/Cards/globalCardStyles.js +3 -2
  130. package/src/stories/Reusable Components/Community/Community.jsx +70 -0
  131. package/src/stories/Reusable Components/Gallery/Gallery.jsx +15 -10
  132. package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +3 -25
  133. package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +19 -7
  134. package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.jsx +0 -2
  135. package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +24 -8
  136. package/src/stories/Reusable Components/Tabs/Tabs.jsx +67 -0
  137. package/src/stories/Sections/Sections.jsx +56 -0
  138. package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +57 -16
  139. package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +70 -1
  140. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +65 -8
  141. package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +14 -7
  142. package/src/stories/Widgets/SpacesListWidget/SpacesListWidget.jsx +78 -0
  143. package/src/stories/Widgets/UsersWidget/UsersWidget.jsx +20 -0
  144. package/src/stories/helpers/util.js +50 -6
  145. package/src/stories/store/communities.js +705 -0
  146. package/src/stories/store/store.js +33 -0
  147. 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
- switch (action) {
31
- case 'add':
32
- setShowModal(true)
33
- break;
34
- default:
35
- break;
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.cardIconClicked(action, index)
76
+ if (!props.preview) {
77
+ props.cardIconClicked(action, index)
78
+ }
41
79
  }
42
80
 
43
- const cardClicked = () => {
44
- console.log('test')
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
- <Container>
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="Create"
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
- iconColor: PropTypes.string,
96
- cardTitleFontSize: PropTypes.number,
97
- cardTitleColor: PropTypes.string,
98
- cardPadding: PropTypes.number
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
  }
@@ -50,18 +90,13 @@ const Folders = ({
50
90
  setShowModal(false)
51
91
  }
52
92
 
53
- console.log(props)
54
-
55
93
  return (
56
94
  <Container>
57
95
  <Gallery
58
- galleryTitle="Your Folders"
96
+ galleryTitle={props.title || "Your Folders"}
59
97
  data={folders}
60
98
  type="flat"
61
99
  cardStyle="card-style-10"
62
- columnsNumber={columnsNumber}
63
- galleryColumnGap={columnGap}
64
- galleryRowGap={rowGap}
65
100
  galleryControls={galleryControls}
66
101
  iconClicked={onIconClicked}
67
102
  cardClicked={cardClicked}
@@ -74,7 +109,8 @@ const Folders = ({
74
109
  closeModal={() => setShowModal(false)}
75
110
  exitModalButton={(e) => (
76
111
  <div></div>
77
- )}>
112
+ )}
113
+ >
78
114
  <CreateFolder
79
115
  saveBtnText="Create"
80
116
  cancelBtnText="Cancel"
@@ -82,18 +118,56 @@ const Folders = ({
82
118
  cancelHandler={cancelHandler}
83
119
  />
84
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>
85
158
  </Container>
86
159
  )
87
160
  }
88
161
 
89
162
  const Container = styled.div`
90
-
163
+ background-color: transparent;
91
164
  `
92
165
 
93
166
  Folders.defaultProps = {};
94
167
 
95
168
  Folders.propTypes = {
96
169
  folders: PropTypes.array,
170
+ title: PropTypes.string,
97
171
  folderTitle: PropTypes.string,
98
172
  columnsNumber: PropTypes.number,
99
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;
@@ -2,19 +2,8 @@ import React from 'react';
2
2
 
3
3
  import Editor from '../../Common Inputs/EditorComponent/EditorComponent';
4
4
 
5
- const ViewNote = () => {
5
+ const ViewNote = ({data, ...props}) => {
6
6
 
7
- const data = {
8
- blocks: [
9
- {
10
- type: "header",
11
- data: {
12
- text: "New Note",
13
- level: 1
14
- }
15
- }
16
- ]
17
- }
18
7
 
19
8
  return (
20
9
  <Editor data={data}/>