@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
@@ -9,64 +9,158 @@ exports.default = void 0;
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
11
 
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
13
+
12
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
15
 
14
- var _react = _interopRequireDefault(require("react"));
16
+ var _react = _interopRequireWildcard(require("react"));
15
17
 
16
18
  var _styledComponents = _interopRequireDefault(require("styled-components"));
17
19
 
18
- var _fakeData = require("../Reusable Components/fakeData");
19
-
20
- var _ReusableHeader = _interopRequireDefault(require("../Reusable Components/ReusableHeader/ReusableHeader"));
20
+ var _bs = require("react-icons/bs");
21
21
 
22
22
  var _ReusableList = _interopRequireDefault(require("../Reusable Components/ReusableList/ReusableList"));
23
23
 
24
24
  var _RichTextInput = _interopRequireDefault(require("../Common Inputs/RichTextInput/RichTextInput"));
25
25
 
26
+ var _ChatPreview = _interopRequireDefault(require("../PreviewComponents/ChatPreview/ChatPreview"));
27
+
28
+ var _ReactModal = _interopRequireDefault(require("../Reusable Components/ReactModal/ReactModal"));
29
+
30
+ var _Community = _interopRequireDefault(require("../Reusable Components/Community/Community"));
31
+
32
+ var _Tabs = _interopRequireDefault(require("../Reusable Components/Tabs/Tabs"));
33
+
34
+ var _Sections = _interopRequireDefault(require("../Sections/Sections"));
35
+
26
36
  var _templateObject;
27
37
 
28
- var _excluded = ["data", "title", "titleColor", "headerBackground", "headerPadding", "cardBackgroundColor", "cardTitleColor", "textColor", "users"];
38
+ var _excluded = ["data", "users", "title", "backgroundColor"];
39
+
40
+ 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); }
41
+
42
+ 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; }
43
+
44
+ var listControls = [{
45
+ icon: /*#__PURE__*/_react.default.createElement(_bs.BsGear, null),
46
+ action: 'config',
47
+ name: 'Config'
48
+ }];
29
49
 
30
50
  var Chat = function Chat(_ref) {
31
51
  var data = _ref.data,
32
- title = _ref.title,
33
- titleColor = _ref.titleColor,
34
- headerBackground = _ref.headerBackground,
35
- headerPadding = _ref.headerPadding,
36
- cardBackgroundColor = _ref.cardBackgroundColor,
37
- cardTitleColor = _ref.cardTitleColor,
38
- textColor = _ref.textColor,
39
52
  users = _ref.users,
53
+ title = _ref.title,
54
+ backgroundColor = _ref.backgroundColor,
40
55
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
56
+
57
+ var _useState = (0, _react.useState)(false),
58
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
59
+ showConfigModal = _useState2[0],
60
+ setShowConfigModal = _useState2[1];
61
+
62
+ var _useState3 = (0, _react.useState)( /*#__PURE__*/_react.default.createElement(Chat, {
63
+ users: users,
64
+ data: data
65
+ })),
66
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
67
+ centerContext = _useState4[0],
68
+ setCenterContext = _useState4[1];
69
+
70
+ var formChanged = function formChanged(values) {
71
+ console.log('context changed');
72
+ setCenterContext( /*#__PURE__*/_react.default.createElement(Chat, Object.assign({
73
+ users: users,
74
+ data: data
75
+ }, values)));
76
+ };
77
+
78
+ var tabs = [{
79
+ title: 'New',
80
+ id: 'preview'
81
+ }, {
82
+ title: 'Context',
83
+ id: 'community'
84
+ }];
85
+ var sections = [{
86
+ title: 'Styles',
87
+ data: [{
88
+ title: 'Styling',
89
+ id: 'styling'
90
+ }]
91
+ }];
92
+
93
+ var onIconClicked = function onIconClicked(action) {
94
+ if (!props.preview) {
95
+ switch (action) {
96
+ case 'config':
97
+ setShowConfigModal(true);
98
+ break;
99
+
100
+ default:
101
+ break;
102
+ }
103
+ }
104
+ };
105
+
41
106
  return /*#__PURE__*/_react.default.createElement(Container, {
42
- cardBackgroundColor: cardBackgroundColor
43
- }, /*#__PURE__*/_react.default.createElement(_ReusableHeader.default, {
44
- title: title,
45
- titleColor: titleColor,
46
- controls: _fakeData.controls,
47
- controlsStyles: {
48
- iconColor: 'white',
49
- maxIcons: 4,
50
- dropdownBackground: 'white'
51
- },
52
- headerBackground: headerBackground,
53
- padding: headerPadding
54
- }), /*#__PURE__*/_react.default.createElement(_ReusableList.default, {
107
+ backgroundColor: backgroundColor
108
+ }, /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
109
+ listTitle: title || 'Chat',
55
110
  type: "flat",
56
111
  data: data,
57
112
  cardStyle: "card-style-8",
113
+ iconClicked: onIconClicked,
114
+ listControls: listControls
115
+ }, props)), /*#__PURE__*/_react.default.createElement(_RichTextInput.default, {
116
+ users: users
117
+ }), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
118
+ modalIsOpen: showConfigModal,
119
+ closeModal: function closeModal() {
120
+ return setShowConfigModal(false);
121
+ },
122
+ exitModalButton: function exitModalButton(e) {
123
+ return /*#__PURE__*/_react.default.createElement("div", null);
124
+ }
125
+ }, /*#__PURE__*/_react.default.createElement(_Sections.default, {
126
+ sections: sections,
127
+ backgroundColor: 'white',
128
+ sectionHeaderStyles: {
129
+ titleColor: 'white',
130
+ headerBackground: 'transparent'
131
+ },
58
132
  customCardStyles: {
59
- cardBackgroundColor: cardBackgroundColor,
60
- cardTitleColor: cardTitleColor,
61
- cardDescriptionColor: textColor
133
+ cardPadding: 6,
134
+ cardTitleFontSize: 15,
135
+ cardBackgroundColor: '#2c2c2c',
136
+ cardTitleColor: 'white',
137
+ onHoverBackgroundColor: '#555555',
138
+ controlsStyles: {
139
+ showOnHover: true
140
+ }
62
141
  }
63
- }), /*#__PURE__*/_react.default.createElement(_RichTextInput.default, {
64
- users: users
65
- }));
142
+ }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
143
+ title: "Chat Config",
144
+ tabs: tabs,
145
+ id: "styling"
146
+ }, /*#__PURE__*/_react.default.createElement(_ChatPreview.default, {
147
+ componentProps: {
148
+ data: data,
149
+ users: users,
150
+ title: props.title || "Chat",
151
+ preview: true
152
+ },
153
+ formChanged: formChanged,
154
+ id: "preview"
155
+ }), /*#__PURE__*/_react.default.createElement(_Community.default, {
156
+ center: centerContext,
157
+ id: "community"
158
+ })))));
66
159
  };
67
160
 
68
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n width: 100%;\n padding: 15px 0;\n"])), function (cardBackgroundColor) {
69
- return cardBackgroundColor;
161
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n background-color: ", ";\n"])), function (_ref2) {
162
+ var backgroundColor = _ref2.backgroundColor;
163
+ return backgroundColor || 'transparent';
70
164
  });
71
165
 
72
166
  Chat.defaultProps = {
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _styledComponents = _interopRequireDefault(require("styled-components"));
19
19
 
20
- var _reactEditorJs = _interopRequireDefault(require("react-editor-js"));
20
+ var _reactEditorJs = require("react-editor-js");
21
21
 
22
22
  var _constants = require("./constants");
23
23
 
@@ -30,6 +30,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
30
30
  var EditorComponent = function EditorComponent(props) {
31
31
  var _instanceRef = (0, _react.useRef)(null);
32
32
 
33
+ var ReactEditorJS = (0, _reactEditorJs.createReactEditorJS)();
34
+
33
35
  function handleSave() {
34
36
  return _handleSave.apply(this, arguments);
35
37
  }
@@ -58,7 +60,7 @@ var EditorComponent = function EditorComponent(props) {
58
60
  return _handleSave.apply(this, arguments);
59
61
  }
60
62
 
61
- return /*#__PURE__*/_react.default.createElement(Container, props, /*#__PURE__*/_react.default.createElement(_reactEditorJs.default, {
63
+ return /*#__PURE__*/_react.default.createElement(Container, props, /*#__PURE__*/_react.default.createElement(ReactEditorJS, {
62
64
  instanceRef: function instanceRef(instance) {
63
65
  return _instanceRef.current = instance;
64
66
  },
@@ -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 _react = _interopRequireWildcard(require("react"));
15
+
16
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
17
+
18
+ var _formik = require("formik");
19
+
20
+ var _reactColor = require("react-color");
21
+
22
+ var _templateObject, _templateObject2;
23
+
24
+ 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); }
25
+
26
+ 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; }
27
+
28
+ var Picker = function Picker(props) {
29
+ var _useField = (0, _formik.useField)(props),
30
+ _useField2 = (0, _slicedToArray2.default)(_useField, 3),
31
+ field = _useField2[0],
32
+ meta = _useField2[1],
33
+ helpers = _useField2[2];
34
+
35
+ {
36
+ return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(Label, Object.assign({
37
+ htmlFor: props.name
38
+ }, props), props.label), /*#__PURE__*/_react.default.createElement(_reactColor.ChromePicker, {
39
+ name: props.name,
40
+ color: field.value,
41
+ onChange: function onChange(color) {
42
+ return helpers.setValue(color.hex);
43
+ },
44
+ onChangeComplete: function onChangeComplete(color) {
45
+ return helpers.setValue(color.hex);
46
+ }
47
+ }));
48
+ }
49
+ };
50
+
51
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n"])));
52
+
53
+ var Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 5px;\n text-transform: capitalize;\n color: ", ";\n font-size: ", "px;\n"])), function (props) {
54
+ return props.labelColor;
55
+ }, function (props) {
56
+ return props.labelFontSize;
57
+ });
58
+
59
+ Picker.defaultProps = {};
60
+ var _default = Picker;
61
+ exports.default = _default;
@@ -27,7 +27,9 @@ var TextField = function TextField(props) {
27
27
 
28
28
  return /*#__PURE__*/_react.default.createElement(TextFieldWrapper, null, /*#__PURE__*/_react.default.createElement(Label, Object.assign({
29
29
  htmlFor: field.name
30
- }, props), props.label), /*#__PURE__*/_react.default.createElement(Input, Object.assign({}, field, props)), meta.error && meta.touched && /*#__PURE__*/_react.default.createElement(Error, null, meta.error));
30
+ }, props), props.label), /*#__PURE__*/_react.default.createElement(Input, Object.assign({
31
+ type: props.type || 'text'
32
+ }, field, props)), meta.error && meta.touched && /*#__PURE__*/_react.default.createElement(Error, null, meta.error));
31
33
  };
32
34
 
33
35
  var TextFieldWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n"])));
@@ -0,0 +1,137 @@
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
13
+
14
+ var _react = _interopRequireWildcard(require("react"));
15
+
16
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
17
+
18
+ var _reactRedux = require("react-redux");
19
+
20
+ var _store = require("../store/store");
21
+
22
+ var _Navbar = _interopRequireDefault(require("../Navbar/Navbar"));
23
+
24
+ var _Body = _interopRequireDefault(require("../Layout/Body/Body"));
25
+
26
+ var _Left = _interopRequireDefault(require("../Layout/Left/Left"));
27
+
28
+ var _Center = _interopRequireDefault(require("../Layout/Center/Center"));
29
+
30
+ var _Right = _interopRequireDefault(require("../Layout/Right/Right"));
31
+
32
+ var _BaseMaterial = _interopRequireDefault(require("../Containers/BaseMaterial"));
33
+
34
+ var _WidgetContainer = _interopRequireDefault(require("../Reusable Components/WidgetContainer/WidgetContainer"));
35
+
36
+ var _Chat = _interopRequireDefault(require("../Chat/Chat"));
37
+
38
+ var _Event = _interopRequireDefault(require("../Events/Event/Event"));
39
+
40
+ var _EventsList = _interopRequireDefault(require("../Events/EventsList/EventsList"));
41
+
42
+ var _Folders = _interopRequireDefault(require("../Library/Folders/Folders"));
43
+
44
+ var _Notes = _interopRequireDefault(require("../Library/Notes/Notes"));
45
+
46
+ var _ViewAlbum = _interopRequireDefault(require("../Music Album/ViewAlbum/ViewAlbum"));
47
+
48
+ var _ViewAlbums = _interopRequireDefault(require("../Music Album/ViewAlbums/ViewAlbums"));
49
+
50
+ var _ViewAlbum2 = _interopRequireDefault(require("../Photo Album/ViewAlbum/ViewAlbum"));
51
+
52
+ var _ViewAlbums2 = _interopRequireDefault(require("../Photo Album/ViewAlbums/ViewAlbums"));
53
+
54
+ var _AlbumsGallery = _interopRequireDefault(require("../VideoAlbum/AlbumsGallery/AlbumsGallery"));
55
+
56
+ var _ViewAlbum3 = _interopRequireDefault(require("../VideoAlbum/ViewAlbum/ViewAlbum"));
57
+
58
+ var _VideoSpace = _interopRequireDefault(require("../VideoAlbum/VideoSpace/VideoSpace"));
59
+
60
+ 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); }
61
+
62
+ 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; }
63
+
64
+ var Community = function Community(props) {
65
+ var _useState = (0, _react.useState)('chat'),
66
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
67
+ spaceType = _useState2[0],
68
+ setSpaceType = _useState2[1];
69
+
70
+ var community = (0, _reactRedux.useSelector)(function (state) {
71
+ return state.communities;
72
+ });
73
+ var space = (0, _reactRedux.useSelector)(function (state) {
74
+ return state.communities.spaces.find(function (x) {
75
+ return x.spaceType === spaceType;
76
+ });
77
+ });
78
+ var spacesWidget = (0, _reactRedux.useSelector)(function (state) {
79
+ return state.communities.spacesListWidget.widgetSpacesList;
80
+ });
81
+ var dispatch = (0, _reactRedux.useDispatch)();
82
+
83
+ var onAddEvent = function onAddEvent(event) {
84
+ dispatch((0, _store.addEvent)(event));
85
+ };
86
+
87
+ console.log(space);
88
+
89
+ var eventIconClicked = function eventIconClicked(action, index) {
90
+ switch (action) {
91
+ case 'delete':
92
+ dispatch((0, _store.deleteEvent)(index));
93
+ break;
94
+
95
+ default:
96
+ break;
97
+ }
98
+ };
99
+
100
+ var switchSpace = function switchSpace(index, props) {
101
+ setSpaceType(props.id);
102
+ };
103
+
104
+ return /*#__PURE__*/_react.default.createElement(_BaseMaterial.default, community.styles, /*#__PURE__*/_react.default.createElement(_Navbar.default, community.navbarStyles), /*#__PURE__*/_react.default.createElement(_Body.default, null, /*#__PURE__*/_react.default.createElement(_Left.default, null, /*#__PURE__*/_react.default.createElement(_WidgetContainer.default, {
105
+ widgetType: "spaces-list",
106
+ widgetProps: (0, _objectSpread2.default)({
107
+ listTitle: spacesWidget.listTitle,
108
+ spaces: spacesWidget.spaces,
109
+ cardClicked: switchSpace,
110
+ headerStyles: spacesWidget.styles.header
111
+ }, spacesWidget.styles.body)
112
+ })), /*#__PURE__*/_react.default.createElement(_Center.default, null, {
113
+ 'chat': /*#__PURE__*/_react.default.createElement(_Chat.default, Object.assign({}, space.spaceProps, space.styles)),
114
+ 'event': /*#__PURE__*/_react.default.createElement(_Event.default, Object.assign({}, space.spaceProps, space.styles)),
115
+ 'events_list': /*#__PURE__*/_react.default.createElement(_EventsList.default, Object.assign({
116
+ cardIconClicked: eventIconClicked,
117
+ onAddEvent: onAddEvent
118
+ }, space.spaceProps, space.styles)),
119
+ 'folders': /*#__PURE__*/_react.default.createElement(_Folders.default, Object.assign({}, space.spaceProps, space.styles)),
120
+ 'notes': /*#__PURE__*/_react.default.createElement(_Notes.default, Object.assign({}, space.spaceProps, space.styles)),
121
+ 'music_album': /*#__PURE__*/_react.default.createElement(_ViewAlbum.default, Object.assign({}, space.spaceProps, space.styles)),
122
+ 'music_albums': /*#__PURE__*/_react.default.createElement(_ViewAlbums.default, Object.assign({}, space.spaceProps, space.styles)),
123
+ 'photo_album': /*#__PURE__*/_react.default.createElement(_ViewAlbum2.default, Object.assign({}, space.spaceProps, space.styles)),
124
+ 'photo_albums': /*#__PURE__*/_react.default.createElement(_ViewAlbums2.default, Object.assign({}, space.spaceProps, space.styles)),
125
+ 'video_albums': /*#__PURE__*/_react.default.createElement(_AlbumsGallery.default, Object.assign({}, space.spaceProps, space.styles)),
126
+ 'video_album': /*#__PURE__*/_react.default.createElement(_ViewAlbum3.default, Object.assign({}, space.spaceProps, space.styles)),
127
+ 'video_space': /*#__PURE__*/_react.default.createElement(_VideoSpace.default, Object.assign({}, space.spaceProps, space.styles))
128
+ }[spaceType]), /*#__PURE__*/_react.default.createElement(_Right.default, null, space.widgets && space.widgets.map(function (widget) {
129
+ return /*#__PURE__*/_react.default.createElement(_WidgetContainer.default, {
130
+ widgetType: widget.widgetType,
131
+ widgetProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, widget.widgetProps), widget.styles)
132
+ });
133
+ }))));
134
+ };
135
+
136
+ var _default = Community;
137
+ exports.default = _default;
@@ -77,7 +77,7 @@ var AddQuestion = function AddQuestion(props) {
77
77
  }));
78
78
  };
79
79
 
80
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: 10px;\n background-color: 'white';\n display: flex;\n flex-direction: column;\n \n &(:first-child){\n align-self: center;\n }\n"])));
80
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n padding: 10px;\n background-color: 'white';\n display: flex;\n flex-direction: column;\n \n &(:first-child){\n align-self: center;\n }\n"])));
81
81
 
82
82
  var _default = AddQuestion;
83
83
  exports.default = _default;
@@ -30,43 +30,31 @@ var DetailedForm = function DetailedForm(_ref) {
30
30
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
31
31
 
32
32
  var onAccept = function onAccept() {
33
- alert('Form Accepted');
33
+ props.onAccept();
34
34
  };
35
35
 
36
36
  var onDecline = function onDecline() {
37
- alert('Form Declined');
37
+ props.onDecline();
38
38
  };
39
39
 
40
- return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(User, null, /*#__PURE__*/_react.default.createElement(_CardStyle.default, {
40
+ return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(User, null, /*#__PURE__*/_react.default.createElement(_CardStyle.default, Object.assign({
41
41
  title: userName,
42
- img: userImg,
43
- cardImageRadius: "100"
44
- })), /*#__PURE__*/_react.default.createElement(_ReusableList.default, {
45
- listTitle: "Form",
42
+ img: userImg
43
+ }, props.userHeaderStyles))), /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
44
+ listTitle: props.title || "Form",
46
45
  data: questions,
47
46
  type: "flat",
48
- cardStyle: "card-style-3",
49
- headerStyles: {
50
- padding: 10,
51
- headerBackground: '#FE1744',
52
- titleColor: '#ffff',
53
- controlsStyles: {
54
- dropdownBackground: 'black',
55
- dropdownFontColor: 'white',
56
- dropdownItemHoverColor: '#FE1744'
57
- }
58
- },
59
- customCardStyles: {
60
- cardPadding: 10
61
- }
62
- }), /*#__PURE__*/_react.default.createElement(Buttons, null, /*#__PURE__*/_react.default.createElement(Accept, {
47
+ cardStyle: "card-style-3"
48
+ }, props)), /*#__PURE__*/_react.default.createElement(Buttons, null, /*#__PURE__*/_react.default.createElement(Accept, {
63
49
  onClick: onAccept
64
50
  }, "Accept"), /*#__PURE__*/_react.default.createElement(Decline, {
65
51
  onClick: onDecline
66
52
  }, "Decline")));
67
53
  };
68
54
 
69
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: white;\n padding: 10px 0;\n width: 100%;\n"])));
55
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n padding: 10px 0;\n width: 100%;\n"])), function (props) {
56
+ return props.backgroundColor || 'transparent';
57
+ });
70
58
 
71
59
  var User = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\n"])));
72
60
 
@@ -19,25 +19,10 @@ var ViewForms = function ViewForms(_ref) {
19
19
  var data = _ref.data,
20
20
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
21
21
  return /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
22
- listTitle: "Submitted Forms",
22
+ listTitle: props.title || "Submitted Forms",
23
23
  data: data,
24
24
  cardStyle: "card-style-9",
25
- type: "sectioned",
26
- sectionHeaderStyles: {
27
- cardTitleColor: 'white',
28
- cardBackgroundColor: 'black',
29
- cardPadding: 10
30
- },
31
- headerStyles: {
32
- padding: 10,
33
- headerBackground: '#FE1744',
34
- titleColor: '#ffff',
35
- controlsStyles: {
36
- dropdownBackground: 'black',
37
- dropdownFontColor: 'white',
38
- dropdownItemHoverColor: '#FE1744'
39
- }
40
- }
25
+ type: "sectioned"
41
26
  }, props));
42
27
  };
43
28
 
@@ -25,13 +25,6 @@ var FillForm = function FillForm(_ref) {
25
25
  var sections = _ref.sections,
26
26
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
27
27
 
28
- // const initialValues = {
29
- // question0: '',
30
- // question1: '',
31
- // question2: '',
32
- // question3: '',
33
- // question4: '',
34
- // }
35
28
  var onCreate = function onCreate(values) {
36
29
  console.log(values);
37
30
  };
@@ -40,21 +33,15 @@ var FillForm = function FillForm(_ref) {
40
33
  console.log('Canceled');
41
34
  };
42
35
 
43
- return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_ReusableForm.default // initialValues={initialValues}
44
- , {
45
- formTitle: "Join Community Form",
36
+ return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_ReusableForm.default, Object.assign({
37
+ formTitle: props.formTitle || 'Join Community Form',
46
38
  sections: sections,
47
39
  saveBtnText: props.saveBtnText,
48
40
  cancelBtnText: props.cancelBtnText,
49
41
  saveHandler: onCreate,
50
42
  cancelHandler: cancelHandler,
51
- headerStyles: {
52
- padding: 10,
53
- headerBackground: 'black',
54
- titleColor: '#ffff'
55
- },
56
- bodyRowGap: 10
57
- }));
43
+ bodyRowGap: props.bodyRowGap || 10
44
+ }, props)));
58
45
  };
59
46
 
60
47
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n"])));