@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
@@ -115,6 +115,10 @@ var SectionBody = _styledComponents.default.div(_templateObject4 || (_templateOb
115
115
  return props.galleryRowGap;
116
116
  });
117
117
 
118
- Gallery.defaultProps = {};
118
+ Gallery.defaultProps = {
119
+ columnsNumber: 3,
120
+ galleryColumnGap: 10,
121
+ galleryRowGap: 20
122
+ };
119
123
  var _default = Gallery;
120
124
  exports.default = _default;
@@ -73,7 +73,7 @@ var ReusableForm = function ReusableForm(_ref) {
73
73
  };
74
74
 
75
75
  var CreateForm = (0, _styledComponents.default)(_formik.Form)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n\n"])), function (props) {
76
- return props.formBackgroundColor || 'white';
76
+ return props.formBackgroundColor || 'transparent';
77
77
  });
78
78
 
79
79
  var FormSection = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px;\n"])), function (props) {
@@ -23,7 +23,7 @@ var _ReusableHeader = _interopRequireDefault(require("../ReusableHeader/Reusable
23
23
 
24
24
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
25
25
 
26
- var _excluded = ["data", "cardStyle", "customCardStyles", "type", "cardControls"];
26
+ var _excluded = ["data", "cardStyle", "customCardStyles", "type", "cardControls", "headerStyles", "sectionHeaderStyles"];
27
27
 
28
28
  var ReusableList = function ReusableList(_ref) {
29
29
  var data = _ref.data,
@@ -32,6 +32,8 @@ var ReusableList = function ReusableList(_ref) {
32
32
  type = _ref.type,
33
33
  _ref$cardControls = _ref.cardControls,
34
34
  cardControls = _ref$cardControls === void 0 ? null : _ref$cardControls,
35
+ headerStyles = _ref.headerStyles,
36
+ sectionHeaderStyles = _ref.sectionHeaderStyles,
35
37
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
38
  var child;
37
39
 
@@ -39,8 +41,8 @@ var ReusableList = function ReusableList(_ref) {
39
41
  props.iconClicked(action);
40
42
  };
41
43
 
42
- var clicked = function clicked(index) {
43
- props.cardClicked(index);
44
+ var clicked = function clicked(index, cardProps) {
45
+ props.cardClicked(index, cardProps);
44
46
  };
45
47
 
46
48
  var cardIconClicked = function cardIconClicked(action, index) {
@@ -59,9 +61,9 @@ var ReusableList = function ReusableList(_ref) {
59
61
  child = data.map(function (section) {
60
62
  return /*#__PURE__*/_react.default.createElement(Section, {
61
63
  priority: section.priority
62
- }, /*#__PURE__*/_react.default.createElement(_CardStyle.default, Object.assign({
64
+ }, /*#__PURE__*/_react.default.createElement(_ReusableHeader.default, Object.assign({
63
65
  title: section.title
64
- }, props.sectionHeaderStyles)), /*#__PURE__*/_react.default.createElement(SectionBody, null, mapOverCardsData(section.data)));
66
+ }, sectionHeaderStyles)), /*#__PURE__*/_react.default.createElement(SectionBody, null, mapOverCardsData(section.data)));
65
67
  });
66
68
  }
67
69
 
@@ -69,7 +71,7 @@ var ReusableList = function ReusableList(_ref) {
69
71
  title: props.listTitle,
70
72
  controls: props.listControls,
71
73
  iconClicked: iconCliked
72
- }, props.headerStyles)), /*#__PURE__*/_react.default.createElement(ListBody, props, child));
74
+ }, headerStyles)), /*#__PURE__*/_react.default.createElement(ListBody, props, child));
73
75
  };
74
76
 
75
77
  var List = _styledComponents.default.ul(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n width: ", ";\n padding: 0;\n > * {\n padding: 0;\n margin: 0;\n }\n"])), function (props) {
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
13
+
14
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
15
+
16
+ var _react = _interopRequireWildcard(require("react"));
17
+
18
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
19
+
20
+ var _ReusableList = _interopRequireDefault(require("../Reusable Components/ReusableList/ReusableList"));
21
+
22
+ var _templateObject, _templateObject2, _templateObject3;
23
+
24
+ var _excluded = ["sections"];
25
+
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
30
+ var Sections = function Sections(_ref) {
31
+ var sections = _ref.sections,
32
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
33
+
34
+ var _useState = (0, _react.useState)(sections[0].data[0].component),
35
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
36
+ center = _useState2[0],
37
+ setCenter = _useState2[1];
38
+
39
+ var cardClicked = function cardClicked(index, cardProps) {
40
+ setCenter(cardProps.component);
41
+ };
42
+
43
+ return /*#__PURE__*/_react.default.createElement(Container, props, /*#__PURE__*/_react.default.createElement(Left, null, /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
44
+ type: "sectioned",
45
+ data: sections,
46
+ cardStyle: "card-style-3",
47
+ cardClicked: cardClicked
48
+ }, props))), /*#__PURE__*/_react.default.createElement(Center, null, center));
49
+ };
50
+
51
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n background-color: #414141;\n display: flex;\n"])), function (props) {
52
+ return props.backgroundColor;
53
+ });
54
+
55
+ var Left = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n"])));
56
+
57
+ var Center = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n flex: 3;\n"])));
58
+
59
+ Sections.defaultProps = {};
60
+ var _default = Sections;
61
+ exports.default = _default;
@@ -106,13 +106,10 @@ var ViewAlbum = function ViewAlbum(_ref) {
106
106
  };
107
107
 
108
108
  return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_Gallery.default, Object.assign({
109
- galleryTitle: "Video Album",
109
+ galleryTitle: props.title || "Video Album",
110
110
  data: album,
111
111
  type: "flat",
112
112
  cardStyle: "card-style-6",
113
- columnsNumber: 3,
114
- galleryColumnGap: 10,
115
- galleryRowGap: 20,
116
113
  galleryControls: galleryControls,
117
114
  iconClicked: onHeaderIconClicked,
118
115
  cardControls: cardControls,
@@ -58,7 +58,7 @@ var MusicPlayerWidget = function MusicPlayerWidget(_ref) {
58
58
  var MusicPlayer = (0, _styledComponents.default)(_reactH5AudioPlayer.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n font-family: ", ";\n background-color: ", ";\n border-radius: ", ";\n padding: ", "px;\n width: ", "px;\n box-shadow: ", ";\n\n .rhap_progress-filled,\n .rhap_progress-indicator {\n background-color: ", ";\n }\n \n .rhap_repeat-button,\n .rhap_main-controls-button,\n .rhap_volume-button,\n .rhap_time {\n color: ", ";\n }\n \n .rhap_download-progress,\n .rhap_volume-bar {\n background-color: gray ;\n }\n \n\n .rhap_volume-indicator {\n background: ", ";\n }\n\n"])), function (props) {
59
59
  return props.fontFamily || 'inherit';
60
60
  }, function (props) {
61
- return props.backgroundColor || 'inherit';
61
+ return props.backgroundColor || 'transparent';
62
62
  }, function (props) {
63
63
  return props.borderRadius ? props.borderRadius + 'px' : 'inherit';
64
64
  }, function (props) {
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.getWidgetType = exports.getCardStyle = exports.addObjectToArray = exports.deleteFromArrayByIndex = exports.stringSearch = void 0;
8
+ exports.getComponentType = exports.getWidgetType = exports.getCardStyle = exports.addObjectToArray = exports.deleteFromArrayByIndex = exports.stringSearch = void 0;
9
9
 
10
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
11
11
 
@@ -39,8 +39,23 @@ var _LogoWidget = _interopRequireDefault(require("../Widgets/LogoWidget/LogoWidg
39
39
 
40
40
  var _VideoPlayer = _interopRequireDefault(require("../VideoAlbum/VideoPlayer/VideoPlayer"));
41
41
 
42
+ var _Notes = _interopRequireDefault(require("../Library/Notes/Notes"));
43
+
44
+ var _Folders = _interopRequireDefault(require("../Library/Folders/Folders"));
45
+
46
+ var _Navbar = _interopRequireDefault(require("../Navbar/Navbar"));
47
+
48
+ var _ViewAlbums = _interopRequireDefault(require("../Music Album/ViewAlbums/ViewAlbums"));
49
+
50
+ var _ViewAlbum = _interopRequireDefault(require("../Music Album/ViewAlbum/ViewAlbum"));
51
+
52
+ var _ViewAlbums2 = _interopRequireDefault(require("../Photo Album/ViewAlbums/ViewAlbums"));
53
+
54
+ var _ViewAlbum2 = _interopRequireDefault(require("../Photo Album/ViewAlbum/ViewAlbum"));
55
+
42
56
  // Cards
43
57
  // Widgets
58
+ // Components
44
59
  var stringSearch = function stringSearch(str, word) {
45
60
  str = str.toUpperCase();
46
61
  word = word.toUpperCase();
@@ -73,7 +88,7 @@ var addObjectToArray = function addObjectToArray(arr, obj) {
73
88
 
74
89
  exports.addObjectToArray = addObjectToArray;
75
90
 
76
- var getCardStyle = function getCardStyle(cardProps, cardType, customCardStyles, cardControls, index, clicked, cardIconClicked) {
91
+ var getCardStyle = function getCardStyle(cardProps, cardType, customCardStyles, cardControls, index, clicked, cardIconClicked, onAction) {
77
92
  var cardTypes = {
78
93
  'card-style-1': /*#__PURE__*/_react.default.createElement(_CardStyle.default, Object.assign({
79
94
  key: index
@@ -89,8 +104,8 @@ var getCardStyle = function getCardStyle(cardProps, cardType, customCardStyles,
89
104
  key: index
90
105
  }, cardProps, customCardStyles, {
91
106
  cardControls: cardControls,
92
- cardClicked: function cardClicked(path) {
93
- return clicked(path);
107
+ cardClicked: function cardClicked() {
108
+ return clicked(index, cardProps);
94
109
  }
95
110
  })),
96
111
  'card-style-4': /*#__PURE__*/_react.default.createElement(_CardStyle4.default, Object.assign({
@@ -136,7 +151,7 @@ var getCardStyle = function getCardStyle(cardProps, cardType, customCardStyles,
136
151
  }, cardProps, customCardStyles, {
137
152
  cardControls: cardControls,
138
153
  cardClicked: function cardClicked() {
139
- return clicked(index);
154
+ return clicked(index, cardProps);
140
155
  },
141
156
  iconClicked: function iconClicked(action) {
142
157
  return cardIconClicked(action, index);
@@ -147,7 +162,7 @@ var getCardStyle = function getCardStyle(cardProps, cardType, customCardStyles,
147
162
  }, cardProps, customCardStyles, {
148
163
  cardControls: cardControls,
149
164
  cardClicked: function cardClicked() {
150
- return clicked(index);
165
+ return clicked(index, cardProps);
151
166
  },
152
167
  iconClicked: function iconClicked(action) {
153
168
  return cardIconClicked(action, index);
@@ -158,7 +173,7 @@ var getCardStyle = function getCardStyle(cardProps, cardType, customCardStyles,
158
173
  }, cardProps, customCardStyles, {
159
174
  cardControls: cardControls,
160
175
  cardClicked: function cardClicked() {
161
- return clicked(index);
176
+ return clicked(index, cardProps);
162
177
  },
163
178
  iconClicked: function iconClicked(action) {
164
179
  return cardIconClicked(action, index);
@@ -179,9 +194,24 @@ var getWidgetType = function getWidgetType(widgetType, props, _cardClicked) {
179
194
  }, props)),
180
195
  'music player': /*#__PURE__*/_react.default.createElement(_MusicPlayerWidget.default, props),
181
196
  'logo': /*#__PURE__*/_react.default.createElement(_LogoWidget.default, props),
182
- 'video player': /*#__PURE__*/_react.default.createElement(_VideoPlayer.default, props)
197
+ 'video player': /*#__PURE__*/_react.default.createElement(_VideoPlayer.default, props),
198
+ 'notes': /*#__PURE__*/_react.default.createElement(_Notes.default, props),
199
+ 'folders': /*#__PURE__*/_react.default.createElement(_Folders.default, props)
183
200
  };
184
201
  return widgetTypes[widgetType];
185
202
  };
186
203
 
187
- exports.getWidgetType = getWidgetType;
204
+ exports.getWidgetType = getWidgetType;
205
+
206
+ var getComponentType = function getComponentType(componentType, componentProps, stylingProps) {
207
+ var componentTypes = {
208
+ 'Navbar': /*#__PURE__*/_react.default.createElement(_Navbar.default, Object.assign({}, componentProps, stylingProps)),
209
+ 'MusicAlbums': /*#__PURE__*/_react.default.createElement(_ViewAlbums.default, Object.assign({}, componentProps, stylingProps)),
210
+ 'MusicAlbum': /*#__PURE__*/_react.default.createElement(_ViewAlbum.default, Object.assign({}, componentProps, stylingProps)),
211
+ 'PhotoAlbum': /*#__PURE__*/_react.default.createElement(_ViewAlbum2.default, Object.assign({}, componentProps, stylingProps)),
212
+ 'PhotoAlbums': /*#__PURE__*/_react.default.createElement(_ViewAlbums2.default, Object.assign({}, componentProps, stylingProps))
213
+ };
214
+ return componentTypes[componentType];
215
+ };
216
+
217
+ exports.getComponentType = getComponentType;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ]
11
11
  ]
12
12
  },
13
- "version": "0.1.14",
13
+ "version": "0.1.18",
14
14
  "private": false,
15
15
  "dependencies": {
16
16
  "@babel/cli": "^7.16.7",
@@ -2,46 +2,25 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import { controls } from '../Reusable Components/fakeData';
6
- import ReusableHeader from '../Reusable Components/ReusableHeader/ReusableHeader';
7
5
  import List from '../Reusable Components/ReusableList/ReusableList';
8
6
  import RichTextInput from '../Common Inputs/RichTextInput/RichTextInput';
9
7
 
10
8
  const Chat = ({
11
9
  data,
12
- title,
13
- titleColor,
14
- headerBackground,
15
- headerPadding,
16
- cardBackgroundColor,
17
- cardTitleColor,
18
- textColor,
19
10
  users,
11
+ title,
12
+ backgroundColor,
20
13
  ...props }) => {
21
14
 
22
15
  return (
23
- <Container
24
- cardBackgroundColor={cardBackgroundColor}>
25
- <ReusableHeader
26
- title={title}
27
- titleColor={titleColor}
28
- controls={controls}
29
- controlsStyles={{
30
- iconColor: 'white',
31
- maxIcons: 4,
32
- dropdownBackground: 'white'
33
- }}
34
- headerBackground={headerBackground}
35
- padding={headerPadding} />
16
+ <Container
17
+ backgroundColor={backgroundColor}>
36
18
  <List
19
+ listTitle={title || 'Chat'}
37
20
  type="flat"
38
21
  data={data}
39
22
  cardStyle="card-style-8"
40
- customCardStyles={{
41
- cardBackgroundColor,
42
- cardTitleColor,
43
- cardDescriptionColor: textColor
44
- }}
23
+ {...props}
45
24
  />
46
25
  <RichTextInput
47
26
  users={users}
@@ -51,9 +30,8 @@ const Chat = ({
51
30
  }
52
31
 
53
32
  const Container = styled.div`
54
- background-color: ${cardBackgroundColor => cardBackgroundColor};
55
33
  width: 100%;
56
- padding: 15px 0;
34
+ background-color: ${({backgroundColor}) => backgroundColor || 'transparent'};
57
35
  `
58
36
 
59
37
  Chat.defaultProps = {
@@ -63,12 +41,9 @@ Chat.defaultProps = {
63
41
  Chat.propTypes = {
64
42
  data: PropTypes.array.isRequired,
65
43
  title: PropTypes.string,
66
- titleColor: PropTypes.string,
67
- headerBackground: PropTypes.string,
68
- headerPadding: PropTypes.number,
69
- cardBackgroundColor: PropTypes.string,
70
- cardTitleColor: PropTypes.string,
71
- textColor: PropTypes.string
44
+ backgroundColor: PropTypes.string,
45
+ customCardStyles: PropTypes.object,
46
+ headerStyles: PropTypes.object
72
47
  }
73
48
 
74
49
  export default Chat
@@ -4,14 +4,14 @@ import PropTypes from "prop-types";
4
4
  import styled from 'styled-components';
5
5
 
6
6
  // Editor.js
7
- import EditorJs from 'react-editor-js';
7
+ import { createReactEditorJS } from 'react-editor-js'
8
8
  // Editor.js Constants
9
9
  import { EDITOR_JS_TOOLS } from "./constants";
10
10
 
11
11
 
12
12
  const EditorComponent = (props) => {
13
13
  const instanceRef = useRef(null)
14
-
14
+ const ReactEditorJS = createReactEditorJS()
15
15
 
16
16
  async function handleSave() {
17
17
  const savedData = await instanceRef.current.save()
@@ -20,7 +20,7 @@ const EditorComponent = (props) => {
20
20
 
21
21
  return (
22
22
  <Container {...props}>
23
- <EditorJs
23
+ <ReactEditorJS
24
24
  instanceRef={(instance) => (instanceRef.current = instance)}
25
25
  tools={EDITOR_JS_TOOLS}
26
26
  data={props.data}
@@ -49,6 +49,7 @@ const AddQuestion = (props) => {
49
49
  }
50
50
 
51
51
  const Container = styled.div`
52
+ width: 100%;
52
53
  padding: 10px;
53
54
  background-color: 'white';
54
55
  display: flex;
@@ -13,11 +13,11 @@ const DetailedForm = ({
13
13
  }) => {
14
14
 
15
15
  const onAccept = () => {
16
- alert('Form Accepted')
16
+ props.onAccept()
17
17
  }
18
18
 
19
19
  const onDecline = () => {
20
- alert('Form Declined')
20
+ props.onDecline()
21
21
  }
22
22
 
23
23
  return (
@@ -26,27 +26,15 @@ const DetailedForm = ({
26
26
  <Card
27
27
  title={userName}
28
28
  img={userImg}
29
- cardImageRadius="100"
29
+ {...props.userHeaderStyles}
30
30
  />
31
31
  </User>
32
32
  <List
33
- listTitle="Form"
33
+ listTitle={props.title || "Form"}
34
34
  data={questions}
35
35
  type='flat'
36
36
  cardStyle='card-style-3'
37
- headerStyles={{
38
- padding: 10,
39
- headerBackground: '#FE1744',
40
- titleColor: '#ffff',
41
- controlsStyles: {
42
- dropdownBackground: 'black',
43
- dropdownFontColor: 'white',
44
- dropdownItemHoverColor: '#FE1744'
45
- },
46
- }}
47
- customCardStyles={{
48
- cardPadding: 10
49
- }}
37
+ {...props}
50
38
  />
51
39
  <Buttons>
52
40
  <Accept onClick={onAccept}>Accept</Accept>
@@ -57,7 +45,7 @@ const DetailedForm = ({
57
45
  }
58
46
 
59
47
  const Container = styled.div`
60
- background-color: white;
48
+ background-color: ${props => props.backgroundColor || 'transparent'};
61
49
  padding: 10px 0;
62
50
  width: 100%;
63
51
  `
@@ -92,7 +80,8 @@ DetailedForm.defaultProps = {};
92
80
  DetailedForm.propTypes = {
93
81
  userName: PropTypes.string,
94
82
  userImg: PropTypes.string,
95
- questions: PropTypes.array
83
+ questions: PropTypes.array,
84
+ title: PropTypes.string
96
85
  }
97
86
 
98
87
  export default DetailedForm
@@ -8,25 +8,11 @@ const ViewForms = ({
8
8
  }) => {
9
9
  return (
10
10
  <List
11
- listTitle="Submitted Form"
11
+ listTitle={props.title || "Submitted Forms"}
12
12
  data={data}
13
13
  cardStyle="card-style-9"
14
14
  type="sectioned"
15
- sectionHeaderStyles={{
16
- cardTitleColor: 'white',
17
- cardBackgroundColor: 'black',
18
- cardPadding: 10
19
- }}
20
- headerStyles={{
21
- padding: 10,
22
- headerBackground: '#FE1744',
23
- titleColor: '#ffff',
24
- controlsStyles: {
25
- dropdownBackground: 'black',
26
- dropdownFontColor: 'white',
27
- dropdownItemHoverColor: '#FE1744'
28
- },
29
- }}
15
+ {...props}
30
16
  />
31
17
  )
32
18
  }
@@ -34,7 +20,8 @@ const ViewForms = ({
34
20
  ViewForms.defaultProps = {};
35
21
 
36
22
  ViewForms.propTypes = {
37
- data: PropTypes.array
23
+ data: PropTypes.array,
24
+ title: PropTypes.string
38
25
  }
39
26
 
40
27
  export default ViewForms
@@ -9,13 +9,6 @@ const FillForm = ({
9
9
  ...props
10
10
  }) => {
11
11
 
12
- // const initialValues = {
13
- // question0: '',
14
- // question1: '',
15
- // question2: '',
16
- // question3: '',
17
- // question4: '',
18
- // }
19
12
 
20
13
  const onCreate = (values) => {
21
14
  console.log(values)
@@ -28,19 +21,14 @@ const FillForm = ({
28
21
  return (
29
22
  <Container>
30
23
  <Form
31
- // initialValues={initialValues}
32
- formTitle="Join Community Form"
24
+ formTitle={props.formTitle || 'Join Community Form'}
33
25
  sections={sections}
34
26
  saveBtnText={props.saveBtnText}
35
27
  cancelBtnText={props.cancelBtnText}
36
28
  saveHandler={onCreate}
37
29
  cancelHandler={cancelHandler}
38
- headerStyles={{
39
- padding: 10,
40
- headerBackground: 'black',
41
- titleColor: '#ffff',
42
- }}
43
- bodyRowGap={10}
30
+ bodyRowGap={props.bodyRowGap || 10}
31
+ {...props}
44
32
  />
45
33
  </Container>
46
34
  )
@@ -55,7 +43,9 @@ FillForm.defaultProps = {};
55
43
  FillForm.propTypes = {
56
44
  sections: PropTypes.array,
57
45
  saveBtnText: PropTypes.string,
58
- cancelBtnText: PropTypes.string
46
+ cancelBtnText: PropTypes.string,
47
+ formTitle: PropTypes.string,
48
+ bodyRowGap: PropTypes.number
59
49
  }
60
50
 
61
51
  export default FillForm;
@@ -47,7 +47,7 @@ const Event = ({
47
47
  const Container = styled.div`
48
48
  width: 100%;
49
49
  font-family: sans-serif;
50
- background-color: ${({ backgroundColor }) => backgroundColor};
50
+ background-color: ${({ backgroundColor }) => backgroundColor || 'transparent'};
51
51
  `
52
52
 
53
53
  const CoverWrapper = styled.div`
@@ -54,9 +54,9 @@ const EventsList = ({
54
54
  }
55
55
 
56
56
  return (
57
- <Container>
57
+ <Container>
58
58
  <List
59
- listTitle="My Events"
59
+ listTitle={props.title || "My Events"}
60
60
  data={events}
61
61
  type='flat'
62
62
  cardStyle="card-style-11"
@@ -74,14 +74,14 @@ const EventsList = ({
74
74
  <div></div>
75
75
  )}>
76
76
  <CreateEvent
77
- saveBtnText="Create"
78
- cancelBtnText="Cancel"
77
+ saveBtnText={props.saveBtnText || 'Create'}
78
+ cancelBtnText={props.cancelBtnText || "Cancel"}
79
79
  saveHandler={onAddFolder}
80
80
  cancelHandler={cancelHandler}
81
81
  />
82
82
  </Modal>
83
83
  </Container>
84
- )
84
+ )
85
85
  }
86
86
 
87
87
  const Container = styled.div`
@@ -92,10 +92,15 @@ EventsList.defaultProps = {};
92
92
 
93
93
  EventsList.propTypes = {
94
94
  notes: PropTypes.array.isRequired,
95
+ title: PropTypes.string,
95
96
  iconColor: PropTypes.string,
96
97
  cardTitleFontSize: PropTypes.number,
97
98
  cardTitleColor: PropTypes.string,
98
- cardPadding: PropTypes.number
99
+ cardPadding: PropTypes.number,
100
+ headerStyles: PropTypes.object,
101
+ customCardStyles: PropTypes.object,
102
+ saveBtnText: PropTypes.string,
103
+ cancelBtnText: PropTypes.string,
99
104
  }
100
105
 
101
106
  export default EventsList
@@ -50,18 +50,13 @@ const Folders = ({
50
50
  setShowModal(false)
51
51
  }
52
52
 
53
- console.log(props)
54
-
55
53
  return (
56
54
  <Container>
57
55
  <Gallery
58
- galleryTitle="Your Folders"
56
+ galleryTitle={props.title || "Your Folders"}
59
57
  data={folders}
60
58
  type="flat"
61
59
  cardStyle="card-style-10"
62
- columnsNumber={columnsNumber}
63
- galleryColumnGap={columnGap}
64
- galleryRowGap={rowGap}
65
60
  galleryControls={galleryControls}
66
61
  iconClicked={onIconClicked}
67
62
  cardClicked={cardClicked}
@@ -87,13 +82,14 @@ const Folders = ({
87
82
  }
88
83
 
89
84
  const Container = styled.div`
90
-
85
+ background-color: transparent;
91
86
  `
92
87
 
93
88
  Folders.defaultProps = {};
94
89
 
95
90
  Folders.propTypes = {
96
91
  folders: PropTypes.array,
92
+ title: PropTypes.string,
97
93
  folderTitle: PropTypes.string,
98
94
  columnsNumber: PropTypes.number,
99
95
  columnGap: PropTypes.number,
@@ -56,7 +56,7 @@ const Notes = ({
56
56
  return (
57
57
  <Container>
58
58
  <List
59
- listTitle="My Notes"
59
+ listTitle={props.title || "My Notes"}
60
60
  data={notes}
61
61
  type='flat'
62
62
  cardStyle="card-style-11"
@@ -74,8 +74,8 @@ const Notes = ({
74
74
  <div></div>
75
75
  )}>
76
76
  <CreateFolder
77
- saveBtnText="Create"
78
- cancelBtnText="Cancel"
77
+ saveBtnText={props.saveBtnText || "Create"}
78
+ cancelBtnText={props.cancelBtnText || "Cancel"}
79
79
  saveHandler={onAddFolder}
80
80
  cancelHandler={cancelHandler}
81
81
  />
@@ -95,7 +95,11 @@ Notes.propTypes = {
95
95
  iconColor: PropTypes.string,
96
96
  cardTitleFontSize: PropTypes.number,
97
97
  cardTitleColor: PropTypes.string,
98
- cardPadding: PropTypes.number
98
+ cardPadding: PropTypes.number,
99
+ saveBtnText: PropTypes.string,
100
+ cancelBtnText: PropTypes.string,
101
+ headerStyles: PropTypes.object,
102
+ customCardStyles: PropTypes.object
99
103
  }
100
104
 
101
105
  export default Notes;