@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
@@ -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,54 +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
- cardBackgroundColor,
22
- cardTitleColor,
23
- cardTitleFontSize,
24
- albumTitleColor,
25
- countColor,
26
- countFontSize,
27
- columnsNumber,
28
- columnGap,
29
- rowGap,
30
27
  ...props }) => {
31
28
 
32
- const cardStyles = {
33
- darkOnHover: true,
34
- cardBackgroundColor,
35
- cardTitleColor,
36
- cardTitleFontSize,
37
- countColor,
38
- countFontSize,
39
- controlsStyles: {
40
- showOnHover: true,
41
- position: 'center',
42
- dropdownFontColor: "white",
43
- iconBorderRadius: 100,
44
- iconSize: 40,
45
- iconsGap: 10,
46
- iconColor: 'white',
47
- containerPadding: 20,
48
- }
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} />)
49
35
  }
50
36
 
51
- const [showModal, setShowModal] = useState(false)
37
+
38
+ let tabs = [
39
+ {
40
+ title: 'New', id: 'preview'
41
+ },
42
+ {
43
+ title: 'Context', id: 'community'
44
+ }
45
+ ]
46
+
52
47
 
53
48
  const onIconClicked = (action) => {
54
- switch (action) {
55
- case 'add':
56
- setShowModal(true)
57
- break;
58
- default:
59
- break;
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
+ }
60
60
  }
61
61
  }
62
62
 
63
63
  const cardIconClicked = (action, index) => {
64
- props.cardIconClicked(action, index)
64
+ if (!props.preview) {
65
+ props.cardIconClicked(action, index)
66
+ }
65
67
  }
66
68
 
67
69
  const onAddAlbum = (album) => {
@@ -76,26 +78,14 @@ const ViewAlbums = ({
76
78
  return (
77
79
  <Container>
78
80
  <Gallery
79
- galleryTitle="Photo Albums"
81
+ galleryTitle={props.title || "Photo Albums"}
80
82
  data={albums}
81
83
  type="flat"
82
84
  cardStyle="card-style-6"
83
- headerStyles={{
84
- padding: 10,
85
- headerBackground: props.headerBackground,
86
- titleColor: props.titleColor,
87
- controlsStyles: {
88
- iconSize: 25
89
- }
90
- }}
91
- columnsNumber={columnsNumber}
92
- galleryColumnGap={columnGap}
93
- galleryRowGap={rowGap}
94
85
  galleryControls={galleryControls}
95
86
  iconClicked={onIconClicked}
96
87
  cardControls={cardControls}
97
88
  cardIconClicked={cardIconClicked}
98
- customCardStyles={cardStyles}
99
89
  {...props} />
100
90
 
101
91
  <Modal
@@ -108,38 +98,47 @@ const ViewAlbums = ({
108
98
  saveHandler={onAddAlbum}
109
99
  cancelHandler={cancelHandler} />
110
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>
111
123
  </Container>
112
124
  )
113
125
  }
114
126
 
115
127
  const Container = styled.div`
116
-
128
+ width: 100%;
117
129
  `
118
130
 
119
- ViewAlbums.defaultProps = {
120
- columnsNumber: 3,
121
- headerBackground: '#FE1744',
122
- titleColor: 'white',
123
- cardBackgroundColor: 'white',
124
- columnGap: 10,
125
- rowGap: 20
126
- };
131
+ ViewAlbums.defaultProps = {};
127
132
 
128
133
  ViewAlbums.propTypes = {
129
134
  albums: PropTypes.array,
130
135
  cardIconClicked: PropTypes.func,
131
136
  onDeleteAlbum: PropTypes.func,
132
137
  onAddAlbum: PropTypes.func,
133
- columnsNumber: PropTypes.number,
134
- headerBackground: PropTypes.string,
135
- titleColor: PropTypes.string,
136
- cardBackgroundColor: PropTypes.string,
137
- columnGap: PropTypes.number,
138
- rowGap: PropTypes.number,
139
- countColor: PropTypes.string,
140
- countFontSize: PropTypes.number,
141
- cardTitleColor: PropTypes.string,
142
- cardTitleFontSize: PropTypes.number,
138
+ title: PropTypes.string,
139
+ headerStyles: PropTypes.object,
140
+ customCardStyles: PropTypes.object,
141
+ preview: PropTypes.bool
143
142
  }
144
143
 
145
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;
@@ -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
+ const EventsPreview = (props) => {
11
+ const [eventsStyles, setEventsStyles] = 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
+ customCardStyles: {
25
+ cardBackgroundColor: '',
26
+ onHoverBackgroundColor: '',
27
+ cardRadius: '',
28
+ cardTitleFontSize: '',
29
+ cardTitleFontWeight: '',
30
+ cardTitleColor: '',
31
+ cardImageRadius: '',
32
+ iconColor: '',
33
+ cardPadding: 0,
34
+ imgSize: 0,
35
+ cardBorderSize: 0,
36
+ cardBorderColor: '',
37
+ dateColor: '',
38
+ controlsStyles: ''
39
+ }
40
+ }
41
+
42
+ const sections = [
43
+ {
44
+ title: "Header Styles",
45
+ body: [
46
+ (<Picker label="Header Background" name="headerStyles.headerBackground" />),
47
+ (<TextField type="number" label="Padding" name="headerStyles.padding" />),
48
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
49
+ (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
50
+ (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
51
+ (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
52
+ (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
53
+ ]
54
+ },
55
+ {
56
+ title: "Card Styles",
57
+ body: [
58
+ (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
59
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
60
+ (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
61
+ (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
62
+ (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
63
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
64
+ (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
65
+ (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
66
+ (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
67
+ (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
68
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
69
+ (<Picker label="Icons Color" name="customCardStyles.iconColor" />),
70
+ (<Picker label="Date Color" name="customCardStyles.dateColor" />),
71
+ (<Picker label="Card Icon Color" name="customCardStyles.controlsStyles.iconColor" />),
72
+ ]
73
+ },
74
+ ]
75
+
76
+ const handleChange = (values) => {
77
+ if(values){
78
+ props.formChanged(values)
79
+ setEventsStyles(values)
80
+ localStorage.setItem('formStyles', JSON.stringify(values))
81
+ }
82
+ }
83
+
84
+ const submitHandler = (values) => {
85
+ console.log(values);
86
+ }
87
+
88
+ const cancelHandler = () => {
89
+ console.log('Canceled')
90
+ }
91
+
92
+ return (
93
+ <Container>
94
+ <Left>
95
+ <ReusableForm
96
+ formTitle="Events 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={'Events'} componentProps={props.componentProps} stylingProps={eventsStyles} />
121
+ </Right>
122
+ </Container>
123
+ );
124
+ };
125
+
126
+ EventsPreview.defaultProps = {};
127
+
128
+ EventsPreview.propTypes = {
129
+ componentProps: PropTypes.object
130
+ }
131
+
132
+ export default EventsPreview;