@mohamed-karawia/library 0.1.18 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/dist/stories/Chat/Chat.js +114 -4
  2. package/dist/stories/Common Inputs/Picker/Picker.js +61 -0
  3. package/dist/stories/Common Inputs/TextField/TextField.js +3 -1
  4. package/dist/stories/Community/Community.js +159 -0
  5. package/dist/stories/Events/Event/Event.js +123 -4
  6. package/dist/stories/Events/EventsList/EventsList.js +98 -16
  7. package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
  8. package/dist/stories/Library/Folders/Folders.js +94 -9
  9. package/dist/stories/Library/Notes/Notes.js +94 -9
  10. package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
  11. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +98 -10
  12. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +96 -34
  13. package/dist/stories/Navbar/Navbar.js +1 -1
  14. package/dist/stories/Pages/Events/Event/Event.js +14 -5
  15. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -15
  16. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +94 -17
  17. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +88 -10
  18. package/dist/stories/Preview/Preview.js +1 -0
  19. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +193 -0
  20. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +158 -0
  21. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +192 -0
  22. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +182 -0
  23. package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +177 -0
  24. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +181 -0
  25. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +153 -0
  26. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +112 -0
  27. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +173 -0
  28. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +189 -0
  29. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +189 -0
  30. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +197 -0
  31. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +189 -0
  32. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +175 -0
  33. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +172 -0
  34. package/dist/stories/PreviewComponents/globalStyles.js +26 -0
  35. package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +4 -3
  36. package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +8 -4
  37. package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.js +10 -4
  38. package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.js +4 -2
  39. package/dist/stories/Reusable Components/Cards/globalCardStyles.js +2 -2
  40. package/dist/stories/Reusable Components/Community/Community.js +53 -0
  41. package/dist/stories/Reusable Components/Gallery/Gallery.js +12 -17
  42. package/dist/stories/Reusable Components/ReactModal/ReactModal.js +11 -30
  43. package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +19 -2
  44. package/dist/stories/Reusable Components/ReusableList/ReusableList.js +9 -5
  45. package/dist/stories/Reusable Components/Tabs/Tabs.js +68 -0
  46. package/dist/stories/Sections/Sections.js +8 -2
  47. package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +85 -19
  48. package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +108 -4
  49. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +84 -9
  50. package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +16 -10
  51. package/dist/stories/Widgets/SpacesListWidget/SpacesListWidget.js +115 -0
  52. package/dist/stories/Widgets/UsersWidget/UsersWidget.js +30 -0
  53. package/dist/stories/helpers/util.js +36 -3
  54. package/dist/stories/store/communities.js +941 -0
  55. package/dist/stories/store/store.js +44 -0
  56. package/package.json +5 -2
  57. package/src/stories/Chat/Chat.jsx +110 -5
  58. package/src/stories/Common Inputs/Picker/Picker.jsx +47 -0
  59. package/src/stories/Common Inputs/TextField/TextField.jsx +1 -1
  60. package/src/stories/Community/Community.jsx +109 -0
  61. package/src/stories/Events/Event/Event.jsx +105 -4
  62. package/src/stories/Events/EventsList/EventsList.jsx +98 -17
  63. package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
  64. package/src/stories/Library/Folders/Folders.jsx +94 -7
  65. package/src/stories/Library/Notes/Notes.jsx +73 -7
  66. package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
  67. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +81 -11
  68. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +78 -34
  69. package/src/stories/Navbar/Navbar.jsx +1 -1
  70. package/src/stories/Pages/Events/Event/Event.jsx +12 -4
  71. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +0 -13
  72. package/src/stories/Pages/ViewWorld/styles.json +1 -1
  73. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +68 -6
  74. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +69 -9
  75. package/src/stories/Preview/Preview.jsx +9 -1
  76. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +132 -0
  77. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +116 -0
  78. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +132 -0
  79. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +127 -0
  80. package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +124 -0
  81. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +126 -0
  82. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +113 -0
  83. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +93 -0
  84. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +122 -0
  85. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +129 -0
  86. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +129 -0
  87. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +138 -0
  88. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +129 -0
  89. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +124 -0
  90. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +125 -0
  91. package/src/stories/PreviewComponents/globalStyles.js +20 -0
  92. package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +5 -2
  93. package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -5
  94. package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.jsx +12 -6
  95. package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.jsx +2 -2
  96. package/src/stories/Reusable Components/Cards/globalCardStyles.js +2 -1
  97. package/src/stories/Reusable Components/Community/Community.jsx +47 -0
  98. package/src/stories/Reusable Components/Gallery/Gallery.jsx +10 -9
  99. package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +3 -25
  100. package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +18 -6
  101. package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +9 -4
  102. package/src/stories/Reusable Components/Tabs/Tabs.jsx +67 -0
  103. package/src/stories/Sections/Sections.jsx +5 -2
  104. package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +64 -16
  105. package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +77 -1
  106. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +64 -9
  107. package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +13 -6
  108. package/src/stories/Widgets/SpacesListWidget/SpacesListWidget.jsx +78 -0
  109. package/src/stories/Widgets/UsersWidget/UsersWidget.jsx +20 -0
  110. package/src/stories/helpers/util.js +24 -2
  111. package/src/stories/store/communities.js +703 -0
  112. package/src/stories/store/store.js +33 -0
  113. package/src/stories/styling.json +92 -0
@@ -0,0 +1,113 @@
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 CustomSelect from '../../Common Inputs/CustomSelect/CustomSelect';
8
+ import Picker from '../../Common Inputs/Picker/Picker';
9
+ import TextField from '../../Common Inputs/TextField/TextField';
10
+
11
+
12
+ const MusicPlayerPreview = (props) => {
13
+ const [musicPlayerStyles, setMusicPlayerStyles] = useState({});
14
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
15
+ headerStyles: {
16
+ headerBackground: '',
17
+ padding: 0,
18
+ titleColor: '',
19
+ titleFontSize: '',
20
+ titleFontWeight: '',
21
+ DiscriptionColor: '',
22
+ DiscriptionFontSize: '',
23
+ DiscriptionFontWeight: '',
24
+ },
25
+ backgroundColor: '',
26
+ primaryColor: '',
27
+ borderRadius: 0,
28
+ padding: 0,
29
+ fontColor: '',
30
+ fontSize: 20,
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
+ ]
43
+ },
44
+ {
45
+ title: "Player Styles",
46
+ body: [
47
+ (<Picker label="Background Color" name="backgroundColor" />),
48
+ (<Picker label="Primary Color" name="primaryColor" />),
49
+ (<TextField type="number" label="Border Radius" name="borderRadius" />),
50
+ (<TextField type="number" label="Padding" name="customCardStyles.cardTitleFontSize" />),
51
+ (<TextField type="number" label="Title Font Weight" name="padding" />),
52
+ (<Picker label="Font Color" name="fontColor" />),
53
+ (<TextField type="number" label="Font Size" name="fontSize" />),
54
+ ]
55
+ },
56
+ ]
57
+
58
+ const handleChange = (values) => {
59
+ if(values){
60
+ props.formChanged(values)
61
+ setMusicPlayerStyles(values)
62
+ localStorage.setItem('formStyles', JSON.stringify(values))
63
+ }
64
+ }
65
+
66
+ const submitHandler = (values) => {
67
+ console.log(values);
68
+ }
69
+
70
+ const cancelHandler = () => {
71
+ console.log('Canceled')
72
+ }
73
+ return (
74
+ <Container>
75
+ <Left>
76
+ <ReusableForm
77
+ formTitle="Music Albums Styles"
78
+ initialValues={initialValues}
79
+ sections={sections}
80
+ headerStyles={{
81
+ padding: 10,
82
+ headerBackground: 'black',
83
+ titleColor: '#ffff',
84
+ }}
85
+ sectionHeaderStyles={{
86
+ padding: 6,
87
+ headerBackground: '#FE1744',
88
+ titleColor: '#ffff',
89
+ }}
90
+ bodyPadding={10}
91
+ saveBtnText="Save"
92
+ cancelBtnText="Cancel"
93
+ saveBtnHandle={submitHandler}
94
+ cancelHandler={cancelHandler}
95
+ handleChange={handleChange}
96
+ bodyRowGap={20}
97
+ bodyColumnGap={10}
98
+ />
99
+ </Left>
100
+ <Right>
101
+ <Preview type={'MusicPlayer'} componentProps={props.componentProps} stylingProps={musicPlayerStyles} da />
102
+ </Right>
103
+ </Container>
104
+ );
105
+ };
106
+
107
+ MusicPlayerPreview.defaultProps = {};
108
+
109
+ MusicPlayerPreview.propTypes = {
110
+ componentProps: PropTypes.object
111
+ }
112
+
113
+ export default MusicPlayerPreview;
@@ -0,0 +1,93 @@
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 CustomSelect from '../../Common Inputs/CustomSelect/CustomSelect';
8
+ import Picker from '../../Common Inputs/Picker/Picker';
9
+
10
+ const NavbarPreview = (props) => {
11
+ const [navbarStyles, setNavbarStyles] = useState({})
12
+
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
+ iconSize: 'md',
15
+ iconBackgroundColor: 'black',
16
+ navbarColor: 'white',
17
+ }
18
+
19
+ const sections = [
20
+ {
21
+ title: "Navbar Styles",
22
+ body: [
23
+ (
24
+ <CustomSelect label="Icon Size" options={[
25
+ { label: 'select an option', value: '' },
26
+ { label: 'small', value: 'sm' },
27
+ { label: 'medium', value: 'md' },
28
+ { label: 'large', value: 'lg' },
29
+ ]} name="iconSize" />
30
+ ),
31
+ (<Picker label="Icon Color" name="iconBackgroundColor" />),
32
+ (<Picker label="Background Color" name="navbarColor" />)
33
+ ]
34
+ },
35
+ ]
36
+
37
+ const handleChange = (values) => {
38
+ if(values){
39
+ props.formChanged(values)
40
+ setNavbarStyles(values)
41
+ localStorage.setItem('formStyles', JSON.stringify(values))
42
+ }
43
+ }
44
+
45
+ const submitHandler = (values) => {
46
+ console.log(values);
47
+ }
48
+
49
+ const cancelHandler = () => {
50
+ console.log('Canceled')
51
+ }
52
+
53
+ return (
54
+ <Container>
55
+ <Left>
56
+ <ReusableForm
57
+ formTitle="Reusable form"
58
+ initialValues={initialValues}
59
+ sections={sections}
60
+ headerStyles={{
61
+ padding: 10,
62
+ headerBackground: 'black',
63
+ titleColor: '#ffff',
64
+ }}
65
+ sectionHeaderStyles={{
66
+ padding: 6,
67
+ headerBackground: '#FE1744',
68
+ titleColor: '#ffff',
69
+ }}
70
+ bodyPadding={10}
71
+ saveBtnText="Save"
72
+ cancelBtnText="Cancel"
73
+ saveBtnHandle={submitHandler}
74
+ cancelHandler={cancelHandler}
75
+ handleChange={handleChange}
76
+ bodyRowGap={20}
77
+ bodyColumnGap={10}
78
+ />
79
+ </Left>
80
+ <Right>
81
+ <Preview type={'Navbar'} stylingProps={navbarStyles} />
82
+ </Right>
83
+ </Container>
84
+ )
85
+ };
86
+
87
+ NavbarPreview.defaultProps = {};
88
+
89
+ NavbarPreview.propTypes = {
90
+ componentProps: PropTypes.object
91
+ }
92
+
93
+ export default NavbarPreview;
@@ -0,0 +1,122 @@
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 NotesPreview = (props) => {
12
+ const [notesStyles, setNotesStyles] = useState({});
13
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
14
+ headerStyles: {
15
+ headerBackground: '',
16
+ padding: 0,
17
+ titleColor: '',
18
+ titleFontSize: '',
19
+ titleFontWeight: '',
20
+ },
21
+ customCardStyles: {
22
+ cardBackgroundColor: '',
23
+ onHoverBackgroundColor: '',
24
+ cardRadius: '',
25
+ cardTitleFontSize: '',
26
+ cardTitleFontWeight: '',
27
+ cardTitleColor: '',
28
+ cardImageRadius: '',
29
+ cardPadding: 0,
30
+ imgSize: 0,
31
+ cardBorderSize: 0,
32
+ cardBorderColor: '',
33
+ iconColor: ''
34
+ }
35
+ }
36
+
37
+ const sections = [
38
+ {
39
+ title: "Header Styles",
40
+ body: [
41
+ (<Picker label="Header Background" name="headerStyles.headerBackground" />),
42
+ (<TextField type="number" label="Padding" name="headerStyles.padding" />),
43
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
44
+ (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
45
+ (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />)
46
+ ]
47
+ },
48
+ {
49
+ title: "Card Styles",
50
+ body: [
51
+ (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
52
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
53
+ (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
54
+ (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
55
+ (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
56
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
57
+ (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
58
+ (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
59
+ (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
60
+ (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
61
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
62
+ (<Picker label="Icon Color" name="customCardStyles.iconColor" />),
63
+ ]
64
+ },
65
+ ]
66
+
67
+ const handleChange = (values) => {
68
+ if(values){
69
+ props.formChanged(values)
70
+ setNotesStyles(values)
71
+ localStorage.setItem('formStyles', JSON.stringify(values))
72
+ }
73
+ }
74
+
75
+ const submitHandler = (values) => {
76
+ console.log(values);
77
+ }
78
+
79
+ const cancelHandler = () => {
80
+ console.log('Canceled')
81
+ }
82
+ return (
83
+ <Container>
84
+ <Left>
85
+ <ReusableForm
86
+ formTitle="Notes Styles"
87
+ initialValues={initialValues}
88
+ sections={sections}
89
+ headerStyles={{
90
+ padding: 10,
91
+ headerBackground: 'black',
92
+ titleColor: '#ffff',
93
+ }}
94
+ sectionHeaderStyles={{
95
+ padding: 6,
96
+ headerBackground: '#FE1744',
97
+ titleColor: '#ffff',
98
+ }}
99
+ bodyPadding={10}
100
+ saveBtnText="Save"
101
+ cancelBtnText="Cancel"
102
+ saveBtnHandle={submitHandler}
103
+ cancelHandler={cancelHandler}
104
+ handleChange={handleChange}
105
+ bodyRowGap={20}
106
+ bodyColumnGap={10}
107
+ />
108
+ </Left>
109
+ <Right>
110
+ <Preview type={'Notes'} componentProps={props.componentProps} stylingProps={notesStyles} />
111
+ </Right>
112
+ </Container>
113
+ );
114
+ };
115
+
116
+ NotesPreview.defaultProps = {};
117
+
118
+ NotesPreview.propTypes = {
119
+ componentProps: PropTypes.object
120
+ }
121
+
122
+ export default NotesPreview;
@@ -0,0 +1,129 @@
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 PhotoAlbumPreview = (props) => {
11
+ const [photoAlbumStyles, setPhotoAlbumStyles] = useState({});
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
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
+ cardDescriptionFontSize: '',
33
+ cardDescriptionColor: '',
34
+ cardPadding: 0,
35
+ imgSize: 0,
36
+ cardBorderSize: 0,
37
+ cardBorderColor: ''
38
+ }
39
+ }
40
+
41
+ const sections = [
42
+ {
43
+ title: "Header Styles",
44
+ body: [
45
+ (<Picker label="Header Background" name="headerStyles.headerBackground" />),
46
+ (<TextField type="number" label="Padding" name="headerStyles.padding" />),
47
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
48
+ (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
49
+ (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
50
+ (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
51
+ (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
52
+ ]
53
+ },
54
+ {
55
+ title: "Card Styles",
56
+ body: [
57
+ (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
58
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
59
+ (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
60
+ (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
61
+ (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
62
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
63
+ (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
64
+ (<TextField type="number" label="Discription Font Size" name="customCardStyles.cardDescriptionFontSize" />),
65
+ (<Picker label="Discription Font Color" name="customCardStyles.cardDescriptionColor" />),
66
+ (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
67
+ (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
68
+ (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
69
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
70
+ ]
71
+ },
72
+ ]
73
+
74
+ const handleChange = (values) => {
75
+ if(values){
76
+ props.formChanged(values)
77
+ setPhotoAlbumStyles(values)
78
+ localStorage.setItem('formStyles', JSON.stringify(values))
79
+ }
80
+ }
81
+
82
+ const submitHandler = (values) => {
83
+ console.log(values);
84
+ }
85
+
86
+ const cancelHandler = () => {
87
+ console.log('Canceled')
88
+ }
89
+ return (
90
+ <Container>
91
+ <Left>
92
+ <ReusableForm
93
+ formTitle="Photo Album Styles"
94
+ initialValues={initialValues}
95
+ sections={sections}
96
+ headerStyles={{
97
+ padding: 10,
98
+ headerBackground: 'black',
99
+ titleColor: '#ffff',
100
+ }}
101
+ sectionHeaderStyles={{
102
+ padding: 6,
103
+ headerBackground: '#FE1744',
104
+ titleColor: '#ffff',
105
+ }}
106
+ bodyPadding={10}
107
+ saveBtnText="Save"
108
+ cancelBtnText="Cancel"
109
+ saveBtnHandle={submitHandler}
110
+ cancelHandler={cancelHandler}
111
+ handleChange={handleChange}
112
+ bodyRowGap={20}
113
+ bodyColumnGap={10}
114
+ />
115
+ </Left>
116
+ <Right>
117
+ <Preview type={'PhotoAlbum'} componentProps={props.componentProps} stylingProps={photoAlbumStyles} />
118
+ </Right>
119
+ </Container>
120
+ );
121
+ };
122
+
123
+ PhotoAlbumPreview.defaultProps = {};
124
+
125
+ PhotoAlbumPreview.propTypes = {
126
+ componentProps: PropTypes.object
127
+ }
128
+
129
+ export default PhotoAlbumPreview;
@@ -0,0 +1,129 @@
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 PhotoAlbumsPreview = (props) => {
11
+ const [photoAlbumsStyles, setPhotoAlbumsStyles] = useState({});
12
+ const initialValues = JSON.parse(localStorage.getItem('formStyles')) || {
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
+ countColor: '',
32
+ countFontSize: '',
33
+ cardImageRadius: '',
34
+ cardPadding: 0,
35
+ imgSize: 0,
36
+ cardBorderSize: 0,
37
+ cardBorderColor: 'purple'
38
+ }
39
+ }
40
+
41
+ const sections = [
42
+ {
43
+ title: "Header Styles",
44
+ body: [
45
+ (<Picker label="Header Background" name="headerStyles.headerBackground" />),
46
+ (<TextField type="number" label="Padding" name="headerStyles.padding" />),
47
+ (<Picker label="Title Color" name="headerStyles.titleColor" />),
48
+ (<TextField type="number" label="Title Font Size" name="headerStyles.titleFontSize" />),
49
+ (<TextField type="number" label="Title Font Weight" name="headerStyles.titleFontWeight" />),
50
+ (<TextField type="number" label="Controls Size" name="headerStyles.controlsStyles.iconSize" />),
51
+ (<Picker label="Controls Color" name="headerStyles.controlsStyles.iconColor" />),
52
+ ]
53
+ },
54
+ {
55
+ title: "Card Styles",
56
+ body: [
57
+ (<Picker label="Card Background" name="customCardStyles.cardBackgroundColor" />),
58
+ (<Picker label="Hover Color" name="customCardStyles.onHoverBackgroundColor" />),
59
+ (<TextField type="number" label="Card Radius" name="customCardStyles.cardRadius" />),
60
+ (<TextField type="number" label="Title Font Size" name="customCardStyles.cardTitleFontSize" />),
61
+ (<TextField type="number" label="Title Font Weight" name="customCardStyles.cardTitleFontWeight" />),
62
+ (<Picker label="Title Color" name="customCardStyles.cardTitleColor" />),
63
+ (<TextField type="number" label="Card Image Radius" name="customCardStyles.cardImageRadius" />),
64
+ (<TextField type="number" label="Count Font Size" name="customCardStyles.countFontSize" />),
65
+ (<Picker label="Count Font Color" name="customCardStyles.countColor" />),
66
+ (<TextField type="number" label="Card Padding" name="customCardStyles.cardPadding" />),
67
+ (<TextField type="number" label="Image Size" name="customCardStyles.imgSize" />),
68
+ (<TextField type="number" label="Border Size" name="customCardStyles.cardBorderSize" />),
69
+ (<Picker label="Border Color" name="customCardStyles.cardBorderColor" />),
70
+ ]
71
+ },
72
+ ]
73
+
74
+ const handleChange = (values) => {
75
+ if(values){
76
+ props.formChanged(values)
77
+ setPhotoAlbumsStyles(values)
78
+ localStorage.setItem('formStyles', JSON.stringify(values))
79
+ }
80
+ }
81
+
82
+ const submitHandler = (values) => {
83
+ console.log(values);
84
+ }
85
+
86
+ const cancelHandler = () => {
87
+ console.log('Canceled')
88
+ }
89
+ return (
90
+ <Container>
91
+ <Left>
92
+ <ReusableForm
93
+ formTitle="Photo Albums Styles"
94
+ initialValues={initialValues}
95
+ sections={sections}
96
+ headerStyles={{
97
+ padding: 10,
98
+ headerBackground: 'black',
99
+ titleColor: '#ffff',
100
+ }}
101
+ sectionHeaderStyles={{
102
+ padding: 6,
103
+ headerBackground: '#FE1744',
104
+ titleColor: '#ffff',
105
+ }}
106
+ bodyPadding={10}
107
+ saveBtnText="Save"
108
+ cancelBtnText="Cancel"
109
+ saveBtnHandle={submitHandler}
110
+ cancelHandler={cancelHandler}
111
+ handleChange={handleChange}
112
+ bodyRowGap={20}
113
+ bodyColumnGap={10}
114
+ />
115
+ </Left>
116
+ <Right>
117
+ <Preview type={'PhotoAlbums'} componentProps={props.componentProps} stylingProps={photoAlbumsStyles} />
118
+ </Right>
119
+ </Container>
120
+ );
121
+ };
122
+
123
+ PhotoAlbumsPreview.defaultProps = {};
124
+
125
+ PhotoAlbumsPreview.propTypes = {
126
+ componentProps: PropTypes.object
127
+ }
128
+
129
+ export default PhotoAlbumsPreview;