@mohamed-karawia/library 0.1.14 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/dist/stories/Chat/Chat.js +11 -34
  2. package/dist/stories/Common Inputs/EditorComponent/EditorComponent.js +4 -2
  3. package/dist/stories/Enrollment/Admin/CreateForm/CreateForm.js +1 -1
  4. package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.js +11 -23
  5. package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +4 -19
  6. package/dist/stories/Enrollment/Guest/FillForm/FillForm.js +4 -17
  7. package/dist/stories/Events/Event/Event.js +1 -1
  8. package/dist/stories/Events/EventsList/EventsList.js +3 -3
  9. package/dist/stories/Library/Folders/Folders.js +2 -6
  10. package/dist/stories/Library/Notes/Notes.js +3 -3
  11. package/dist/stories/Library/ViewNote/ViewNote.js +7 -10
  12. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +5 -14
  13. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +6 -12
  14. package/dist/stories/Navbar/Navbar.js +14 -44
  15. package/dist/stories/Pages/Chat/Chat.js +13 -1
  16. package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +19 -1
  17. package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +7 -1
  18. package/dist/stories/Pages/Enrollment/Forms/Forms.js +29 -2
  19. package/dist/stories/Pages/Events/Events/Events.js +6 -0
  20. package/dist/stories/Pages/Library/Folders/Library.js +7 -1
  21. package/dist/stories/Pages/Library/Notes/Notes.js +5 -0
  22. package/dist/stories/Pages/Music/MusicAlbum/Music.js +12 -5
  23. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +43 -1
  24. package/dist/stories/Pages/Photos/Album/Album.js +7 -1
  25. package/dist/stories/Pages/Photos/Albums/Albums.js +38 -2
  26. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +4 -18
  27. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +5 -51
  28. package/dist/stories/Preview/Preview.js +36 -0
  29. package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +7 -3
  30. package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +7 -1
  31. package/dist/stories/Reusable Components/Cards/Card-style-3/CardStyle3.js +3 -2
  32. package/dist/stories/Reusable Components/Cards/Card-style-9/CardStyle9.js +27 -12
  33. package/dist/stories/Reusable Components/Cards/globalCardStyles.js +1 -1
  34. package/dist/stories/Reusable Components/Gallery/Gallery.js +5 -1
  35. package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +1 -1
  36. package/dist/stories/Reusable Components/ReusableList/ReusableList.js +8 -6
  37. package/dist/stories/Sections/Sections.js +61 -0
  38. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +1 -4
  39. package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +1 -1
  40. package/dist/stories/helpers/util.js +39 -9
  41. package/package.json +1 -1
  42. package/src/stories/Chat/Chat.jsx +10 -35
  43. package/src/stories/Common Inputs/EditorComponent/EditorComponent.jsx +3 -3
  44. package/src/stories/Enrollment/Admin/CreateForm/CreateForm.jsx +1 -0
  45. package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.jsx +8 -19
  46. package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +4 -17
  47. package/src/stories/Enrollment/Guest/FillForm/FillForm.jsx +6 -16
  48. package/src/stories/Events/Event/Event.jsx +1 -1
  49. package/src/stories/Events/EventsList/EventsList.jsx +11 -6
  50. package/src/stories/Library/Folders/Folders.jsx +3 -7
  51. package/src/stories/Library/Notes/Notes.jsx +8 -4
  52. package/src/stories/Library/ViewNote/ViewNote.jsx +1 -12
  53. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +9 -11
  54. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +7 -11
  55. package/src/stories/Navbar/Navbar.jsx +50 -48
  56. package/src/stories/Pages/Chat/Chat.jsx +17 -4
  57. package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +20 -1
  58. package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +6 -0
  59. package/src/stories/Pages/Enrollment/Forms/Forms.jsx +30 -2
  60. package/src/stories/Pages/Events/Events/Events.jsx +78 -72
  61. package/src/stories/Pages/Library/Folders/Library.jsx +7 -1
  62. package/src/stories/Pages/Library/Notes/Notes.jsx +5 -0
  63. package/src/stories/Pages/Music/MusicAlbum/Music.jsx +16 -8
  64. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +38 -24
  65. package/src/stories/Pages/Photos/Album/Album.jsx +7 -1
  66. package/src/stories/Pages/Photos/Albums/Albums.jsx +25 -20
  67. package/src/stories/Pages/ViewWorld/styles.json +1 -1
  68. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +6 -17
  69. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +6 -60
  70. package/src/stories/Preview/Preview.jsx +27 -0
  71. package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +8 -4
  72. package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -0
  73. package/src/stories/Reusable Components/Cards/Card-style-3/CardStyle3.jsx +5 -2
  74. package/src/stories/Reusable Components/Cards/Card-style-9/CardStyle9.jsx +14 -8
  75. package/src/stories/Reusable Components/Cards/globalCardStyles.js +1 -1
  76. package/src/stories/Reusable Components/Gallery/Gallery.jsx +5 -1
  77. package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +1 -1
  78. package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.jsx +0 -2
  79. package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +17 -6
  80. package/src/stories/Sections/Sections.jsx +53 -0
  81. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +3 -5
  82. package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +1 -1
  83. package/src/stories/helpers/util.js +29 -7
@@ -0,0 +1,53 @@
1
+ import React, {useState} from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+
5
+ import ReusableList from '../Reusable Components/ReusableList/ReusableList';
6
+
7
+
8
+
9
+ const Sections = ({sections, ...props}) => {
10
+ const [center, setCenter] = useState(sections[0].data[0].component)
11
+
12
+ const cardClicked = (index, cardProps) => {
13
+ setCenter(cardProps.component)
14
+ }
15
+
16
+ return (
17
+ <Container {...props}>
18
+ <Left>
19
+ <ReusableList
20
+ type='sectioned'
21
+ data={sections}
22
+ cardStyle='card-style-3'
23
+ cardClicked={cardClicked}
24
+ {...props}
25
+ />
26
+ </Left>
27
+ <Center>{center}</Center>
28
+ </Container>
29
+ )
30
+ }
31
+
32
+ const Container = styled.div`
33
+ background-color: ${props => props.backgroundColor};
34
+ background-color: #414141;
35
+ display: flex;
36
+ `
37
+
38
+ const Left = styled.div`
39
+ flex: 1;
40
+ `
41
+
42
+ const Center = styled.div`
43
+ flex: 3;
44
+ `
45
+
46
+ Sections.defaultProps = {};
47
+
48
+ Sections.propTypes = {
49
+ sections: PropTypes.array.isRequired,
50
+ backgroundColor: PropTypes.string,
51
+ }
52
+
53
+ export default Sections;
@@ -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;
@@ -15,6 +15,14 @@ import ReusableList from '../Reusable Components/ReusableList/ReusableList';
15
15
  import MusicPlayerWidget from '../Widgets/MusicPlayerWidget/MusicPlayerWidget';
16
16
  import LogoWidget from '../Widgets/LogoWidget/LogoWidget';
17
17
  import VideoPlayer from '../VideoAlbum/VideoPlayer/VideoPlayer';
18
+ import Notes from '../Library/Notes/Notes';
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';
18
26
 
19
27
  export const stringSearch = (str, word) => {
20
28
  str = str.toUpperCase();
@@ -40,18 +48,18 @@ export const addObjectToArray = (arr, obj) => {
40
48
  return newArray;
41
49
  }
42
50
 
43
- export const getCardStyle = (cardProps, cardType, customCardStyles, cardControls, index, clicked, cardIconClicked) => {
51
+ export const getCardStyle = (cardProps, cardType, customCardStyles, cardControls, index, clicked, cardIconClicked, onAction) => {
44
52
  const cardTypes = {
45
53
  'card-style-1': (<CardStyle1 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} />),
46
54
  'card-style-2': (<CardStyle2 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls}/>),
47
- 'card-style-3': (<CardStyle3 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={(path) => clicked(path)}/>),
55
+ 'card-style-3': (<CardStyle3 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index, cardProps)}/>),
48
56
  'card-style-4': (<CardStyle4 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls}/>),
49
57
  'card-style-6': (<CardStyle6 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index, cardProps)} iconClicked={(action) => cardIconClicked(action, index)} />),
50
58
  'card-style-7': (<CardStyle7 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index)} iconClicked={(action) => cardIconClicked(action, index)} />),
51
59
  'card-style-8': (<CardStyle8 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index)} iconClicked={(action) => cardIconClicked(action, index)} />),
52
- 'card-style-9': (<CardStyle9 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index)} iconClicked={(action) => cardIconClicked(action, index)} />),
53
- 'card-style-10': (<CardStyle10 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index)} iconClicked={(action) => cardIconClicked(action, index)} />),
54
- 'card-style-11': (<CardStyle11 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index)} iconClicked={(action) => cardIconClicked(action, index)} />),
60
+ 'card-style-9': (<CardStyle9 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index, cardProps)} iconClicked={(action) => cardIconClicked(action, index)}/>),
61
+ 'card-style-10': (<CardStyle10 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index, cardProps)} iconClicked={(action) => cardIconClicked(action, index)} />),
62
+ 'card-style-11': (<CardStyle11 key={index} {...cardProps} {...customCardStyles} cardControls={cardControls} cardClicked={() => clicked(index, cardProps)} iconClicked={(action) => cardIconClicked(action, index)} />),
55
63
  }
56
64
  return cardTypes[cardType]
57
65
  };
@@ -61,7 +69,21 @@ export const getWidgetType = (widgetType, props, cardClicked) => {
61
69
  'list': (<ReusableList cardClicked={(path) => cardClicked(path)} {...props}/>),
62
70
  'music player': (<MusicPlayerWidget {...props} />),
63
71
  'logo': (<LogoWidget {...props}/>),
64
- 'video player': (<VideoPlayer {...props}/>)
72
+ 'video player': (<VideoPlayer {...props}/>),
73
+ 'notes': (<Notes {...props}/>),
74
+ 'folders': (<Folders {...props}/>),
65
75
  }
66
76
  return widgetTypes[widgetType]
67
- }
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
+