@mohamed-karawia/library 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/dist/stories/Chat/Chat.js +10 -12
  2. package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.js +10 -12
  3. package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +1 -1
  4. package/dist/stories/Enrollment/Guest/FillForm/FillForm.js +4 -17
  5. package/dist/stories/Events/Event/Event.js +1 -1
  6. package/dist/stories/Events/EventsList/EventsList.js +3 -3
  7. package/dist/stories/Library/Folders/Folders.js +1 -4
  8. package/dist/stories/Library/Notes/Notes.js +3 -3
  9. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +4 -6
  10. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +3 -6
  11. package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +8 -0
  12. package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +7 -1
  13. package/dist/stories/Pages/Enrollment/Forms/Forms.js +3 -1
  14. package/dist/stories/Pages/Events/Events/Events.js +1 -0
  15. package/dist/stories/Pages/Music/MusicAlbum/Music.js +8 -6
  16. package/dist/stories/Pages/Photos/Albums/Albums.js +4 -1
  17. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +4 -10
  18. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +3 -16
  19. package/dist/stories/Preview/Preview.js +36 -0
  20. package/dist/stories/Reusable Components/Gallery/Gallery.js +5 -1
  21. package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +1 -1
  22. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +1 -4
  23. package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +1 -1
  24. package/dist/stories/helpers/util.js +26 -2
  25. package/package.json +1 -1
  26. package/src/stories/Chat/Chat.jsx +9 -12
  27. package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.jsx +7 -9
  28. package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +3 -2
  29. package/src/stories/Enrollment/Guest/FillForm/FillForm.jsx +6 -16
  30. package/src/stories/Events/Event/Event.jsx +1 -1
  31. package/src/stories/Events/EventsList/EventsList.jsx +11 -6
  32. package/src/stories/Library/Folders/Folders.jsx +2 -4
  33. package/src/stories/Library/Notes/Notes.jsx +8 -4
  34. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +9 -4
  35. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +6 -7
  36. package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +10 -1
  37. package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +6 -0
  38. package/src/stories/Pages/Enrollment/Forms/Forms.jsx +3 -1
  39. package/src/stories/Pages/Events/Events/Events.jsx +75 -74
  40. package/src/stories/Pages/Library/Folders/Library.jsx +1 -1
  41. package/src/stories/Pages/Music/MusicAlbum/Music.jsx +8 -6
  42. package/src/stories/Pages/Photos/Albums/Albums.jsx +3 -0
  43. package/src/stories/Pages/ViewWorld/styles.json +1 -1
  44. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +6 -9
  45. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +5 -25
  46. package/src/stories/Preview/Preview.jsx +27 -0
  47. package/src/stories/Reusable Components/Gallery/Gallery.jsx +5 -1
  48. package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +1 -1
  49. package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.jsx +0 -2
  50. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +3 -5
  51. package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +1 -1
  52. package/src/stories/helpers/util.js +19 -1
@@ -20,9 +20,6 @@ const ViewAlbum = ({
20
20
  album,
21
21
  cardBackgroundColor,
22
22
  imgTitleColor,
23
- columnsNumber,
24
- columnGap,
25
- rowGap,
26
23
  descColor,
27
24
  ...props
28
25
  }) => {
@@ -111,13 +108,10 @@ const ViewAlbum = ({
111
108
  return (
112
109
  <Container>
113
110
  <Gallery
114
- galleryTitle="Photo Album"
111
+ galleryTitle={props.title || "Photo Album"}
115
112
  data={album}
116
113
  type="flat"
117
114
  cardStyle="card-style-6"
118
- columnsNumber={columnsNumber}
119
- galleryColumnGap={columnGap}
120
- galleryRowGap={rowGap}
121
115
  galleryControls={galleryControls}
122
116
  iconClicked={onIconClicked}
123
117
  cardClicked={cardClicked}
@@ -135,8 +129,8 @@ const ViewAlbum = ({
135
129
  <AddPhoto
136
130
  saveHandler={onAddPhoto}
137
131
  cancelHandler={cancelHandler}
138
- saveBtnText={'Add'}
139
- cancelBtnText={'Cancel'} />
132
+ saveBtnText={props.saveBtnText || 'Add'}
133
+ cancelBtnText={props.saveBtnText || 'Cancel'} />
140
134
  </Modal>
141
135
  <Modal
142
136
  modalIsOpen={showImgModal}
@@ -237,6 +231,9 @@ ViewAlbum.propTypes = {
237
231
  cardBackgroundColor: PropTypes.string,
238
232
  imgTitleColor: PropTypes.string,
239
233
  descColor: PropTypes.string,
234
+ title: PropTypes.string,
235
+ saveBtnText: PropTypes.string,
236
+ saveBtnText: PropTypes.string,
240
237
  }
241
238
 
242
239
  export default ViewAlbum;
@@ -18,9 +18,6 @@ const galleryControls = [
18
18
 
19
19
  const ViewAlbums = ({
20
20
  albums,
21
- columnsNumber,
22
- columnGap,
23
- rowGap,
24
21
  ...props }) => {
25
22
 
26
23
  const [showModal, setShowModal] = useState(false)
@@ -51,13 +48,10 @@ const ViewAlbums = ({
51
48
  return (
52
49
  <Container>
53
50
  <Gallery
54
- galleryTitle="Photo Albums"
51
+ galleryTitle={props.title || "Photo Albums"}
55
52
  data={albums}
56
53
  type="flat"
57
54
  cardStyle="card-style-6"
58
- columnsNumber={columnsNumber}
59
- galleryColumnGap={columnGap}
60
- galleryRowGap={rowGap}
61
55
  galleryControls={galleryControls}
62
56
  iconClicked={onIconClicked}
63
57
  cardControls={cardControls}
@@ -82,30 +76,16 @@ const Container = styled.div`
82
76
  width: 100%;
83
77
  `
84
78
 
85
- ViewAlbums.defaultProps = {
86
- columnsNumber: 3,
87
- headerBackground: '#FE1744',
88
- titleColor: 'white',
89
- cardBackgroundColor: 'white',
90
- columnGap: 10,
91
- rowGap: 20
92
- };
79
+ ViewAlbums.defaultProps = {};
93
80
 
94
81
  ViewAlbums.propTypes = {
95
82
  albums: PropTypes.array,
96
83
  cardIconClicked: PropTypes.func,
97
84
  onDeleteAlbum: PropTypes.func,
98
85
  onAddAlbum: PropTypes.func,
99
- columnsNumber: PropTypes.number,
100
- headerBackground: PropTypes.string,
101
- titleColor: PropTypes.string,
102
- cardBackgroundColor: PropTypes.string,
103
- columnGap: PropTypes.number,
104
- rowGap: PropTypes.number,
105
- countColor: PropTypes.string,
106
- countFontSize: PropTypes.number,
107
- cardTitleColor: PropTypes.string,
108
- cardTitleFontSize: PropTypes.number,
86
+ title: PropTypes.string,
87
+ headerStyles: PropTypes.object,
88
+ customCardStyles: PropTypes.object
109
89
  }
110
90
 
111
91
  export default ViewAlbums
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import ProopTypes 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
+ export default Preview;
@@ -91,7 +91,11 @@ const SectionBody = styled.div`
91
91
  row-gap: ${props => props.galleryRowGap}px;
92
92
  `
93
93
 
94
- Gallery.defaultProps = {};
94
+ Gallery.defaultProps = {
95
+ columnsNumber: 3,
96
+ galleryColumnGap: 10,
97
+ galleryRowGap: 20
98
+ };
95
99
 
96
100
  Gallery.propTypes = {
97
101
  data: PropTypes.array.isRequired,
@@ -69,7 +69,7 @@ const ReusableForm = ({ formTitle, sections, initialValues, ...props }) => {
69
69
  }
70
70
 
71
71
  const CreateForm = styled(Form)`
72
- background-color: ${props => props.formBackgroundColor || 'white'};
72
+ background-color: ${props => props.formBackgroundColor || 'transparent'};
73
73
  display: flex;
74
74
  flex-direction: column;
75
75
 
@@ -63,8 +63,6 @@ ReusableHeader.propTypes = {
63
63
  controlsStyles: PropTypes.object,
64
64
  headerBackground: PropTypes.string,
65
65
  padding: PropTypes.number,
66
- horizontalPadding: PropTypes.number,
67
- headerMarginBottom: PropTypes.number,
68
66
  titleColor: PropTypes.string,
69
67
  titleFontSize: PropTypes.number,
70
68
  titleFontWeight: PropTypes.number,
@@ -75,13 +75,10 @@ const ViewAlbum = ({
75
75
  return (
76
76
  <Container>
77
77
  <Gallery
78
- galleryTitle="Video Album"
78
+ galleryTitle={props.title || "Video Album"}
79
79
  data={album}
80
80
  type="flat"
81
81
  cardStyle="card-style-6"
82
- columnsNumber={3}
83
- galleryColumnGap={10}
84
- galleryRowGap={20}
85
82
  galleryControls={galleryControls}
86
83
  iconClicked={onHeaderIconClicked}
87
84
  cardControls={cardControls}
@@ -116,7 +113,8 @@ ViewAlbum.propTypes = {
116
113
  cardTitleFontSize: PropTypes.number,
117
114
  descColor: PropTypes.string,
118
115
  cardIconClicked: PropTypes.func,
119
- onAddAlbum: PropTypes.func
116
+ onAddAlbum: PropTypes.func,
117
+ title: PropTypes.string
120
118
  }
121
119
 
122
120
  export default ViewAlbum
@@ -44,7 +44,7 @@ const MusicPlayerWidget = ({currentSong , ...props}) => {
44
44
  const MusicPlayer = styled(AudioPlayer)`
45
45
 
46
46
  font-family: ${props => props.fontFamily || 'inherit'};
47
- background-color: ${props => props.backgroundColor || 'inherit'};
47
+ background-color: ${props => props.backgroundColor || 'transparent'};
48
48
  border-radius: ${props => props.borderRadius ? props.borderRadius + 'px' : 'inherit'};
49
49
  padding: ${props => props.padding ? props.padding + 'px' : 'inherit'}px;
50
50
  width: ${props => props.width}px;
@@ -17,6 +17,12 @@ import LogoWidget from '../Widgets/LogoWidget/LogoWidget';
17
17
  import VideoPlayer from '../VideoAlbum/VideoPlayer/VideoPlayer';
18
18
  import Notes from '../Library/Notes/Notes';
19
19
  import Folders from '../Library/Folders/Folders'
20
+ // Components
21
+ import Navbar from '../Navbar/Navbar';
22
+ import MusicAlbums from '../Music Album/ViewAlbums/ViewAlbums';
23
+ import MusicAlbum from '../Music Album/ViewAlbum/ViewAlbum';
24
+ import PhotoAlbums from '../Photo Album/ViewAlbums/ViewAlbums'
25
+ import PhotoAlbum from '../Photo Album/ViewAlbum/ViewAlbum';
20
26
 
21
27
  export const stringSearch = (str, word) => {
22
28
  str = str.toUpperCase();
@@ -68,4 +74,16 @@ export const getWidgetType = (widgetType, props, cardClicked) => {
68
74
  'folders': (<Folders {...props}/>),
69
75
  }
70
76
  return widgetTypes[widgetType]
71
- }
77
+ }
78
+
79
+ export const getComponentType = (componentType, componentProps, stylingProps) => {
80
+ const componentTypes = {
81
+ 'Navbar': (<Navbar {...componentProps} {...stylingProps}/>),
82
+ 'MusicAlbums': (<MusicAlbums {...componentProps} {...stylingProps}/>),
83
+ 'MusicAlbum': (<MusicAlbum {...componentProps} {...stylingProps}/>),
84
+ 'PhotoAlbum': (<PhotoAlbum {...componentProps} {...stylingProps}/>),
85
+ 'PhotoAlbums': (<PhotoAlbums {...componentProps}{...stylingProps}/>),
86
+ }
87
+ return componentTypes[componentType]
88
+ }
89
+