@mohamed-karawia/library 0.1.18 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/dist/stories/Chat/Chat.js +114 -4
  2. package/dist/stories/Common Inputs/Picker/Picker.js +61 -0
  3. package/dist/stories/Common Inputs/TextField/TextField.js +3 -1
  4. package/dist/stories/Community/Community.js +159 -0
  5. package/dist/stories/Events/Event/Event.js +123 -4
  6. package/dist/stories/Events/EventsList/EventsList.js +98 -16
  7. package/dist/stories/Forms/CreateSpace/CreateSpace.js +75 -0
  8. package/dist/stories/Library/Folders/Folders.js +94 -9
  9. package/dist/stories/Library/Notes/Notes.js +94 -9
  10. package/dist/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.js +54 -0
  11. package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +98 -10
  12. package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +96 -34
  13. package/dist/stories/Navbar/Navbar.js +1 -1
  14. package/dist/stories/Pages/Events/Event/Event.js +14 -5
  15. package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +2 -15
  16. package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +94 -17
  17. package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +88 -10
  18. package/dist/stories/Preview/Preview.js +1 -0
  19. package/dist/stories/PreviewComponents/ChatPreview/ChatPreview.js +193 -0
  20. package/dist/stories/PreviewComponents/EventPreview/EventPreview.js +158 -0
  21. package/dist/stories/PreviewComponents/EventsPreview/EventsPreview.js +192 -0
  22. package/dist/stories/PreviewComponents/FoldersPreview/FoldersPreview.js +182 -0
  23. package/dist/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.js +177 -0
  24. package/dist/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.js +181 -0
  25. package/dist/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.js +153 -0
  26. package/dist/stories/PreviewComponents/NavbarPreview/NavbarPreview.js +112 -0
  27. package/dist/stories/PreviewComponents/NotesPreview/NotesPreview.js +173 -0
  28. package/dist/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.js +189 -0
  29. package/dist/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.js +189 -0
  30. package/dist/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.js +197 -0
  31. package/dist/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.js +189 -0
  32. package/dist/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.js +175 -0
  33. package/dist/stories/PreviewComponents/VideoPreview/VideoPreview.js +172 -0
  34. package/dist/stories/PreviewComponents/globalStyles.js +26 -0
  35. package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +4 -3
  36. package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +8 -4
  37. package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.js +10 -4
  38. package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.js +4 -2
  39. package/dist/stories/Reusable Components/Cards/globalCardStyles.js +2 -2
  40. package/dist/stories/Reusable Components/Community/Community.js +53 -0
  41. package/dist/stories/Reusable Components/Gallery/Gallery.js +12 -17
  42. package/dist/stories/Reusable Components/ReactModal/ReactModal.js +11 -30
  43. package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +19 -2
  44. package/dist/stories/Reusable Components/ReusableList/ReusableList.js +9 -5
  45. package/dist/stories/Reusable Components/Tabs/Tabs.js +68 -0
  46. package/dist/stories/Sections/Sections.js +8 -2
  47. package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +85 -19
  48. package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +108 -4
  49. package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +84 -9
  50. package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +16 -10
  51. package/dist/stories/Widgets/SpacesListWidget/SpacesListWidget.js +115 -0
  52. package/dist/stories/Widgets/UsersWidget/UsersWidget.js +30 -0
  53. package/dist/stories/helpers/util.js +36 -3
  54. package/dist/stories/store/communities.js +941 -0
  55. package/dist/stories/store/store.js +44 -0
  56. package/package.json +5 -2
  57. package/src/stories/Chat/Chat.jsx +110 -5
  58. package/src/stories/Common Inputs/Picker/Picker.jsx +47 -0
  59. package/src/stories/Common Inputs/TextField/TextField.jsx +1 -1
  60. package/src/stories/Community/Community.jsx +109 -0
  61. package/src/stories/Events/Event/Event.jsx +105 -4
  62. package/src/stories/Events/EventsList/EventsList.jsx +98 -17
  63. package/src/stories/Forms/CreateSpace/CreateSpace.jsx +73 -0
  64. package/src/stories/Library/Folders/Folders.jsx +94 -7
  65. package/src/stories/Library/Notes/Notes.jsx +73 -7
  66. package/src/stories/Modals/NavbarPreviewModal/NavbarPreviewModal.jsx +31 -0
  67. package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +81 -11
  68. package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +78 -34
  69. package/src/stories/Navbar/Navbar.jsx +1 -1
  70. package/src/stories/Pages/Events/Event/Event.jsx +12 -4
  71. package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +0 -13
  72. package/src/stories/Pages/ViewWorld/styles.json +1 -1
  73. package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +68 -6
  74. package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +69 -9
  75. package/src/stories/Preview/Preview.jsx +9 -1
  76. package/src/stories/PreviewComponents/ChatPreview/ChatPreview.jsx +132 -0
  77. package/src/stories/PreviewComponents/EventPreview/EventPreview.jsx +116 -0
  78. package/src/stories/PreviewComponents/EventsPreview/EventsPreview.jsx +132 -0
  79. package/src/stories/PreviewComponents/FoldersPreview/FoldersPreview.jsx +127 -0
  80. package/src/stories/PreviewComponents/MusicAlbumPreview/MusicAlbumPreview.jsx +124 -0
  81. package/src/stories/PreviewComponents/MusicAlbumsPreview/MusicAlbumsPreview.jsx +126 -0
  82. package/src/stories/PreviewComponents/MusicPlayerPreview/MusicPlayerPreview.jsx +113 -0
  83. package/src/stories/PreviewComponents/NavbarPreview/NavbarPreview.jsx +93 -0
  84. package/src/stories/PreviewComponents/NotesPreview/NotesPreview.jsx +122 -0
  85. package/src/stories/PreviewComponents/PhotoAlbumPreview/PhotoAlbumPreview.jsx +129 -0
  86. package/src/stories/PreviewComponents/PhotoAlbumsPreview/PhotoAlbumsPreview.jsx +129 -0
  87. package/src/stories/PreviewComponents/SpacesListPreview/SpacesListPreview.jsx +138 -0
  88. package/src/stories/PreviewComponents/VideoAlbumPreview/VideoAlbumPreview.jsx +129 -0
  89. package/src/stories/PreviewComponents/VideoAlbumsPreview/VideoAlbumsPreview.jsx +124 -0
  90. package/src/stories/PreviewComponents/VideoPreview/VideoPreview.jsx +125 -0
  91. package/src/stories/PreviewComponents/globalStyles.js +20 -0
  92. package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +5 -2
  93. package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +5 -5
  94. package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.jsx +12 -6
  95. package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.jsx +2 -2
  96. package/src/stories/Reusable Components/Cards/globalCardStyles.js +2 -1
  97. package/src/stories/Reusable Components/Community/Community.jsx +47 -0
  98. package/src/stories/Reusable Components/Gallery/Gallery.jsx +10 -9
  99. package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +3 -25
  100. package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +18 -6
  101. package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +9 -4
  102. package/src/stories/Reusable Components/Tabs/Tabs.jsx +67 -0
  103. package/src/stories/Sections/Sections.jsx +5 -2
  104. package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +64 -16
  105. package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +77 -1
  106. package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +64 -9
  107. package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +13 -6
  108. package/src/stories/Widgets/SpacesListWidget/SpacesListWidget.jsx +78 -0
  109. package/src/stories/Widgets/UsersWidget/UsersWidget.jsx +20 -0
  110. package/src/stories/helpers/util.js +24 -2
  111. package/src/stories/store/communities.js +703 -0
  112. package/src/stories/store/store.js +33 -0
  113. package/src/stories/styling.json +92 -0
@@ -9,36 +9,146 @@ 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
 
20
+ var _bs = require("react-icons/bs");
21
+
18
22
  var _ReusableList = _interopRequireDefault(require("../Reusable Components/ReusableList/ReusableList"));
19
23
 
20
24
  var _RichTextInput = _interopRequireDefault(require("../Common Inputs/RichTextInput/RichTextInput"));
21
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
+
22
36
  var _templateObject;
23
37
 
24
- var _excluded = ["data", "users", "title", "backgroundColor"];
38
+ var _excluded = ["data", "users", "title", "backgroundColor", "community"];
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
+ }];
25
49
 
26
50
  var Chat = function Chat(_ref) {
27
51
  var data = _ref.data,
28
52
  users = _ref.users,
29
53
  title = _ref.title,
30
54
  backgroundColor = _ref.backgroundColor,
55
+ community = _ref.community,
31
56
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
57
+
58
+ var _useState = (0, _react.useState)(false),
59
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
60
+ showConfigModal = _useState2[0],
61
+ setShowConfigModal = _useState2[1];
62
+
63
+ var _useState3 = (0, _react.useState)( /*#__PURE__*/_react.default.createElement(Chat, {
64
+ preview: true,
65
+ users: users,
66
+ data: data
67
+ })),
68
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
69
+ centerContext = _useState4[0],
70
+ setCenterContext = _useState4[1];
71
+
72
+ var formChanged = function formChanged(values) {
73
+ setCenterContext( /*#__PURE__*/_react.default.createElement(Chat, Object.assign({
74
+ preview: true,
75
+ users: users,
76
+ data: data
77
+ }, values)));
78
+ };
79
+
80
+ var tabs = [{
81
+ title: 'New',
82
+ id: 'preview'
83
+ }, {
84
+ title: 'Context',
85
+ id: 'community'
86
+ }]; // let sections = [
87
+ // {
88
+ // title: 'Styles',
89
+ // data: [
90
+ // {
91
+ // title: 'Styling',
92
+ // id: 'styling'
93
+ // }
94
+ // ]
95
+ // }
96
+ // ]
97
+
98
+ var onIconClicked = function onIconClicked(action) {
99
+ if (!props.preview) {
100
+ switch (action) {
101
+ case 'config':
102
+ setShowConfigModal(true);
103
+ break;
104
+
105
+ default:
106
+ break;
107
+ }
108
+ }
109
+ };
110
+
111
+ var cancelConfig = function cancelConfig() {
112
+ setShowConfigModal(false);
113
+ localStorage.removeItem('formStyles');
114
+ };
115
+
32
116
  return /*#__PURE__*/_react.default.createElement(Container, {
33
117
  backgroundColor: backgroundColor
34
118
  }, /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
35
119
  listTitle: title || 'Chat',
36
120
  type: "flat",
37
121
  data: data,
38
- cardStyle: "card-style-8"
122
+ cardStyle: "card-style-8",
123
+ iconClicked: onIconClicked,
124
+ listControls: listControls
39
125
  }, props)), /*#__PURE__*/_react.default.createElement(_RichTextInput.default, {
40
126
  users: users
41
- }));
127
+ }), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
128
+ modalIsOpen: showConfigModal,
129
+ closeModal: cancelConfig,
130
+ exitModalButton: function exitModalButton(e) {
131
+ return /*#__PURE__*/_react.default.createElement("div", null);
132
+ },
133
+ preview: true
134
+ }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
135
+ title: "Chat Config",
136
+ tabs: tabs,
137
+ id: "styling"
138
+ }, /*#__PURE__*/_react.default.createElement(_ChatPreview.default, {
139
+ componentProps: {
140
+ data: data,
141
+ users: users,
142
+ title: props.title || "Chat",
143
+ preview: true
144
+ },
145
+ formChanged: formChanged,
146
+ id: "preview"
147
+ }), /*#__PURE__*/_react.default.createElement(_Community.default, {
148
+ center: centerContext,
149
+ community: community,
150
+ id: "community"
151
+ }))));
42
152
  };
43
153
 
44
154
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n background-color: ", ";\n"])), function (_ref2) {
@@ -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,159 @@
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(community);
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
+ }, spacesWidget.styles)
111
+ })), /*#__PURE__*/_react.default.createElement(_Center.default, null, {
112
+ 'chat': /*#__PURE__*/_react.default.createElement(_Chat.default, Object.assign({
113
+ community: community
114
+ }, space.spaceProps, space.styles)),
115
+ 'event': /*#__PURE__*/_react.default.createElement(_Event.default, Object.assign({
116
+ community: community
117
+ }, space.spaceProps, space.styles)),
118
+ 'events_list': /*#__PURE__*/_react.default.createElement(_EventsList.default, Object.assign({
119
+ community: community,
120
+ cardIconClicked: eventIconClicked,
121
+ onAddEvent: onAddEvent
122
+ }, space.spaceProps, space.styles)),
123
+ 'folders': /*#__PURE__*/_react.default.createElement(_Folders.default, Object.assign({
124
+ community: community
125
+ }, space.spaceProps, space.styles)),
126
+ 'notes': /*#__PURE__*/_react.default.createElement(_Notes.default, Object.assign({
127
+ community: community
128
+ }, space.spaceProps, space.styles)),
129
+ 'music_album': /*#__PURE__*/_react.default.createElement(_ViewAlbum.default, Object.assign({
130
+ community: community
131
+ }, space.spaceProps, space.styles)),
132
+ 'music_albums': /*#__PURE__*/_react.default.createElement(_ViewAlbums.default, Object.assign({
133
+ community: community
134
+ }, space.spaceProps, space.styles)),
135
+ 'photo_album': /*#__PURE__*/_react.default.createElement(_ViewAlbum2.default, Object.assign({
136
+ community: community
137
+ }, space.spaceProps, space.styles)),
138
+ 'photo_albums': /*#__PURE__*/_react.default.createElement(_ViewAlbums2.default, Object.assign({
139
+ community: community
140
+ }, space.spaceProps, space.styles)),
141
+ 'video_albums': /*#__PURE__*/_react.default.createElement(_AlbumsGallery.default, Object.assign({
142
+ community: community
143
+ }, space.spaceProps, space.styles)),
144
+ 'video_album': /*#__PURE__*/_react.default.createElement(_ViewAlbum3.default, Object.assign({
145
+ community: community
146
+ }, space.spaceProps, space.styles)),
147
+ 'video_space': /*#__PURE__*/_react.default.createElement(_VideoSpace.default, Object.assign({
148
+ community: community
149
+ }, space.spaceProps, space.styles))
150
+ }[spaceType]), /*#__PURE__*/_react.default.createElement(_Right.default, null, space.widgets && space.widgets.map(function (widget) {
151
+ return /*#__PURE__*/_react.default.createElement(_WidgetContainer.default, {
152
+ widgetType: widget.widgetType,
153
+ widgetProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, widget.widgetProps), widget.styles)
154
+ });
155
+ }))));
156
+ };
157
+
158
+ var _default = Community;
159
+ exports.default = _default;
@@ -9,14 +9,45 @@ exports.default = void 0;
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
11
 
12
- var _react = _interopRequireDefault(require("react"));
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"));
13
17
 
14
18
  var _styledComponents = _interopRequireDefault(require("styled-components"));
15
19
 
20
+ var _bs = require("react-icons/bs");
21
+
16
22
  var _ReusableHeader = _interopRequireDefault(require("../../Reusable Components/ReusableHeader/ReusableHeader"));
17
23
 
24
+ var _ReactModal = _interopRequireDefault(require("../../Reusable Components/ReactModal/ReactModal"));
25
+
26
+ var _EventPreview = _interopRequireDefault(require("../../PreviewComponents/EventPreview/EventPreview"));
27
+
28
+ var _Tabs = _interopRequireDefault(require("../../Reusable Components/Tabs/Tabs"));
29
+
30
+ var _Sections = _interopRequireDefault(require("../../Sections/Sections"));
31
+
32
+ var _WidgetContainer = _interopRequireDefault(require("../../Reusable Components/WidgetContainer/WidgetContainer"));
33
+
34
+ var _Community = _interopRequireDefault(require("../../Reusable Components/Community/Community"));
35
+
18
36
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
19
37
 
38
+ var _excluded = ["cover", "title", "date", "disc", "backgroundColor", "titleColor", "titleSize", "dateColor", "dateSize", "discColor", "discSize", "headerStyles", "community"];
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
+ // import styles from '../../styling.json'
45
+ var listControls = [{
46
+ icon: /*#__PURE__*/_react.default.createElement(_bs.BsGear, null),
47
+ action: 'config',
48
+ name: 'Config'
49
+ }];
50
+
20
51
  var Event = function Event(_ref) {
21
52
  var cover = _ref.cover,
22
53
  title = _ref.title,
@@ -29,11 +60,75 @@ var Event = function Event(_ref) {
29
60
  dateSize = _ref.dateSize,
30
61
  discColor = _ref.discColor,
31
62
  discSize = _ref.discSize,
32
- headerStyles = _ref.headerStyles;
63
+ headerStyles = _ref.headerStyles,
64
+ community = _ref.community,
65
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
66
+
67
+ var _useState = (0, _react.useState)(false),
68
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
69
+ showConfigModal = _useState2[0],
70
+ setShowConfigModal = _useState2[1];
71
+
72
+ var _useState3 = (0, _react.useState)( /*#__PURE__*/_react.default.createElement(Event, {
73
+ preview: true,
74
+ title: title,
75
+ cover: cover,
76
+ date: date,
77
+ disc: disc
78
+ })),
79
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
80
+ centerContext = _useState4[0],
81
+ setCenterContext = _useState4[1];
82
+
83
+ var formChanged = function formChanged(values) {
84
+ setCenterContext( /*#__PURE__*/_react.default.createElement(Event, Object.assign({
85
+ preview: true,
86
+ title: title,
87
+ cover: cover,
88
+ date: date,
89
+ disc: disc
90
+ }, values)));
91
+ };
92
+
93
+ var tabs = [{
94
+ title: 'New',
95
+ id: 'preview'
96
+ }, {
97
+ title: 'Context',
98
+ id: 'community'
99
+ }];
100
+ var sections = [{
101
+ title: 'Styles',
102
+ data: [{
103
+ title: 'Styling',
104
+ id: 'styling'
105
+ }]
106
+ }];
107
+
108
+ var onIconClicked = function onIconClicked(action) {
109
+ if (!props.preview) {
110
+ switch (action) {
111
+ case 'config':
112
+ setShowConfigModal(true);
113
+ break;
114
+
115
+ default:
116
+ break;
117
+ }
118
+ }
119
+ };
120
+
121
+ var cancelConfig = function cancelConfig() {
122
+ setShowConfigModal(false);
123
+ localStorage.removeItem('formStyles');
124
+ };
125
+
33
126
  return /*#__PURE__*/_react.default.createElement(Container, {
34
127
  backgroundColor: backgroundColor
35
128
  }, /*#__PURE__*/_react.default.createElement(_ReusableHeader.default, Object.assign({
36
- title: title
129
+ title: title,
130
+ controls: listControls,
131
+ iconClicked: onIconClicked
37
132
  }, headerStyles)), /*#__PURE__*/_react.default.createElement(CoverWrapper, null, /*#__PURE__*/_react.default.createElement(Cover, {
38
133
  src: cover
39
134
  })), /*#__PURE__*/_react.default.createElement(Details, null, /*#__PURE__*/_react.default.createElement(Header, null, /*#__PURE__*/_react.default.createElement(Title, {
@@ -45,7 +140,31 @@ var Event = function Event(_ref) {
45
140
  }, date)), /*#__PURE__*/_react.default.createElement(Disc, {
46
141
  discColor: discColor,
47
142
  discSize: discSize
48
- }, disc)));
143
+ }, disc)), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
144
+ modalIsOpen: showConfigModal,
145
+ closeModal: cancelConfig,
146
+ exitModalButton: function exitModalButton(e) {
147
+ return /*#__PURE__*/_react.default.createElement("div", null);
148
+ }
149
+ }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
150
+ title: "Event Config",
151
+ tabs: tabs
152
+ }, /*#__PURE__*/_react.default.createElement(_EventPreview.default, {
153
+ componentProps: {
154
+ cover: cover,
155
+ title: title,
156
+ date: date,
157
+ disc: disc,
158
+ preview: true
159
+ },
160
+ formChanged: formChanged,
161
+ id: "preview"
162
+ }), /*#__PURE__*/_react.default.createElement(_Community.default, {
163
+ center: centerContext,
164
+ community: community,
165
+ preview: true,
166
+ id: "community"
167
+ }))));
49
168
  };
50
169
 
51
170
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n font-family: sans-serif;\n background-color: ", ";\n"])), function (_ref2) {