@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
@@ -19,15 +19,25 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
19
19
 
20
20
  var _ai = require("react-icons/ai");
21
21
 
22
+ var _bs = require("react-icons/bs");
23
+
22
24
  var _ReusableList = _interopRequireDefault(require("../../Reusable Components/ReusableList/ReusableList"));
23
25
 
24
26
  var _ReactModal = _interopRequireDefault(require("../../Reusable Components/ReactModal/ReactModal"));
25
27
 
26
28
  var _CreateEvent = _interopRequireDefault(require("../CreateEvent/CreateEvent"));
27
29
 
30
+ var _EventsPreview = _interopRequireDefault(require("../../PreviewComponents/EventsPreview/EventsPreview"));
31
+
32
+ var _Tabs = _interopRequireDefault(require("../../Reusable Components/Tabs/Tabs"));
33
+
34
+ var _Sections = _interopRequireDefault(require("../../Sections/Sections"));
35
+
36
+ var _Community = _interopRequireDefault(require("../../Reusable Components/Community/Community"));
37
+
28
38
  var _templateObject;
29
39
 
30
- var _excluded = ["events", "iconColor", "cardTitleFontSize", "cardTitleColor", "cardPadding"];
40
+ var _excluded = ["events", "community"];
31
41
 
32
42
  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); }
33
43
 
@@ -37,6 +47,10 @@ var listControls = [{
37
47
  icon: /*#__PURE__*/_react.default.createElement(_ai.AiOutlineFileAdd, null),
38
48
  action: 'add',
39
49
  name: 'Add Photo'
50
+ }, {
51
+ icon: /*#__PURE__*/_react.default.createElement(_bs.BsGear, null),
52
+ action: 'config',
53
+ name: 'Config'
40
54
  }];
41
55
  var cardControls = [{
42
56
  icon: /*#__PURE__*/_react.default.createElement(_ai.AiFillDelete, null),
@@ -46,10 +60,7 @@ var cardControls = [{
46
60
 
47
61
  var EventsList = function EventsList(_ref) {
48
62
  var events = _ref.events,
49
- iconColor = _ref.iconColor,
50
- cardTitleFontSize = _ref.cardTitleFontSize,
51
- cardTitleColor = _ref.cardTitleColor,
52
- cardPadding = _ref.cardPadding,
63
+ community = _ref.community,
53
64
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
54
65
 
55
66
  var _useState = (0, _react.useState)(false),
@@ -57,23 +68,68 @@ var EventsList = function EventsList(_ref) {
57
68
  showModal = _useState2[0],
58
69
  setShowModal = _useState2[1];
59
70
 
60
- var onIconClicked = function onIconClicked(action) {
61
- switch (action) {
62
- case 'add':
63
- setShowModal(true);
64
- break;
71
+ var _useState3 = (0, _react.useState)(false),
72
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
73
+ showConfigModal = _useState4[0],
74
+ setShowConfigModal = _useState4[1];
75
+
76
+ var _useState5 = (0, _react.useState)( /*#__PURE__*/_react.default.createElement(EventsList, Object.assign({
77
+ preview: true,
78
+ events: events
79
+ }, props))),
80
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
81
+ centerContext = _useState6[0],
82
+ setCenterContext = _useState6[1];
83
+
84
+ var formChanged = function formChanged(values) {
85
+ setCenterContext( /*#__PURE__*/_react.default.createElement(EventsList, Object.assign({
86
+ preview: true,
87
+ events: events
88
+ }, values)));
89
+ };
65
90
 
66
- default:
67
- break;
91
+ var tabs = [{
92
+ title: 'New',
93
+ id: 'preview'
94
+ }, {
95
+ title: 'Context',
96
+ id: 'community'
97
+ }];
98
+ var sections = [{
99
+ title: 'Styles',
100
+ data: [{
101
+ title: 'Styling',
102
+ id: 'styling'
103
+ }]
104
+ }];
105
+
106
+ var onIconClicked = function onIconClicked(action) {
107
+ if (!props.preview) {
108
+ switch (action) {
109
+ case 'add':
110
+ setShowModal(true);
111
+ break;
112
+
113
+ case 'config':
114
+ setShowConfigModal(true);
115
+ break;
116
+
117
+ default:
118
+ break;
119
+ }
68
120
  }
69
121
  };
70
122
 
71
123
  var cardIconClicked = function cardIconClicked(action, index) {
72
- props.cardIconClicked(action, index);
124
+ if (!props.preview) {
125
+ props.cardIconClicked(action, index);
126
+ }
73
127
  };
74
128
 
75
- var cardClicked = function cardClicked() {
76
- console.log('test');
129
+ var cardClicked = function cardClicked(index, props) {
130
+ if (!props.preview) {
131
+ props.cardClicked(props);
132
+ }
77
133
  };
78
134
 
79
135
  var cancelHandler = function cancelHandler() {
@@ -85,6 +141,11 @@ var EventsList = function EventsList(_ref) {
85
141
  props.onAddEvent(event);
86
142
  };
87
143
 
144
+ var cancelConfig = function cancelConfig() {
145
+ setShowConfigModal(false);
146
+ localStorage.removeItem('formStyles');
147
+ };
148
+
88
149
  return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
89
150
  listTitle: props.title || "My Events",
90
151
  data: events,
@@ -108,7 +169,28 @@ var EventsList = function EventsList(_ref) {
108
169
  cancelBtnText: props.cancelBtnText || "Cancel",
109
170
  saveHandler: onAddFolder,
110
171
  cancelHandler: cancelHandler
111
- })));
172
+ })), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
173
+ modalIsOpen: showConfigModal,
174
+ closeModal: cancelConfig,
175
+ exitModalButton: function exitModalButton(e) {
176
+ return /*#__PURE__*/_react.default.createElement("div", null);
177
+ }
178
+ }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
179
+ title: "Events Config",
180
+ tabs: tabs
181
+ }, /*#__PURE__*/_react.default.createElement(_EventsPreview.default, {
182
+ componentProps: {
183
+ events: events,
184
+ title: props.title || "My Events",
185
+ preview: true
186
+ },
187
+ formChanged: formChanged,
188
+ id: "preview"
189
+ }), /*#__PURE__*/_react.default.createElement(_Community.default, {
190
+ center: centerContext,
191
+ community: community,
192
+ id: "community"
193
+ }))));
112
194
  };
113
195
 
114
196
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n"])));
@@ -0,0 +1,75 @@
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 _react = _interopRequireDefault(require("react"));
13
+
14
+ var Yup = _interopRequireWildcard(require("yup"));
15
+
16
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
17
+
18
+ var _ReusableForm = _interopRequireDefault(require("../../Reusable Components/ReusableForm/ReusableForm"));
19
+
20
+ var _TextField = _interopRequireDefault(require("../../Common Inputs/TextField/TextField"));
21
+
22
+ var _templateObject;
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 CreateSpace = function CreateSpace(props) {
29
+ var initialValues = {
30
+ title: ''
31
+ };
32
+ var formSchema = Yup.object().shape({
33
+ title: Yup.string().required("Required")
34
+ });
35
+ var sections = [{
36
+ title: "Space Details",
37
+ body: [/*#__PURE__*/_react.default.createElement(_TextField.default, {
38
+ label: "Title",
39
+ name: "title"
40
+ })],
41
+ hideTitle: false
42
+ }];
43
+
44
+ var onCreate = function onCreate(values) {
45
+ props.saveHandler(values);
46
+ };
47
+
48
+ var cancelHandler = function cancelHandler() {
49
+ props.cancelHandler();
50
+ };
51
+
52
+ return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_ReusableForm.default, Object.assign({
53
+ formTitle: props.title || "Create Space",
54
+ initialValues: initialValues,
55
+ formSchema: formSchema,
56
+ sections: sections,
57
+ saveBtnText: props.saveBtnText || 'Create',
58
+ cancelBtnText: props.cancelBtnText || 'Cancel',
59
+ saveHandler: onCreate,
60
+ cancelHandler: cancelHandler,
61
+ headerStyles: {
62
+ padding: 10,
63
+ headerBackground: 'black',
64
+ titleColor: '#ffff'
65
+ },
66
+ sectionPadding: 10,
67
+ bodyRowGap: 10
68
+ }, props.formStyles)));
69
+ };
70
+
71
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n"])));
72
+
73
+ CreateSpace.defaultProps = {};
74
+ var _default = CreateSpace;
75
+ exports.default = _default;
@@ -19,15 +19,25 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
19
19
 
20
20
  var _ai = require("react-icons/ai");
21
21
 
22
+ var _bs = require("react-icons/bs");
23
+
22
24
  var _Gallery = _interopRequireDefault(require("../../Reusable Components/Gallery/Gallery"));
23
25
 
24
26
  var _ReactModal = _interopRequireDefault(require("../../Reusable Components/ReactModal/ReactModal"));
25
27
 
26
28
  var _CreateFolder = _interopRequireDefault(require("../CreateFolder/CreateFolder"));
27
29
 
30
+ var _Tabs = _interopRequireDefault(require("../../Reusable Components/Tabs/Tabs"));
31
+
32
+ var _Sections = _interopRequireDefault(require("../../Sections/Sections"));
33
+
34
+ var _FoldersPreview = _interopRequireDefault(require("../../PreviewComponents/FoldersPreview/FoldersPreview"));
35
+
36
+ var _Community = _interopRequireDefault(require("../../Reusable Components/Community/Community"));
37
+
28
38
  var _templateObject;
29
39
 
30
- var _excluded = ["folders", "folderTitle", "columnsNumber", "columnGap", "rowGap", "cardClicked", "iconColor"];
40
+ var _excluded = ["folders", "folderTitle", "columnsNumber", "columnGap", "rowGap", "cardClicked", "iconColor", "community"];
31
41
 
32
42
  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); }
33
43
 
@@ -37,6 +47,10 @@ var galleryControls = [{
37
47
  icon: /*#__PURE__*/_react.default.createElement(_ai.AiOutlineFileAdd, null),
38
48
  action: 'add',
39
49
  name: 'Add Photo'
50
+ }, {
51
+ icon: /*#__PURE__*/_react.default.createElement(_bs.BsGear, null),
52
+ action: 'config',
53
+ name: 'Config'
40
54
  }];
41
55
  var cardControls = [{
42
56
  icon: /*#__PURE__*/_react.default.createElement(_ai.AiFillDelete, null),
@@ -52,6 +66,7 @@ var Folders = function Folders(_ref) {
52
66
  rowGap = _ref.rowGap,
53
67
  cardClicked = _ref.cardClicked,
54
68
  iconColor = _ref.iconColor,
69
+ community = _ref.community,
55
70
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
56
71
 
57
72
  var _useState = (0, _react.useState)(false),
@@ -59,14 +74,63 @@ var Folders = function Folders(_ref) {
59
74
  showModal = _useState2[0],
60
75
  setShowModal = _useState2[1];
61
76
 
62
- var onIconClicked = function onIconClicked(action) {
63
- switch (action) {
64
- case 'add':
65
- setShowModal(true);
66
- break;
77
+ var _useState3 = (0, _react.useState)(false),
78
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
79
+ showConfigModal = _useState4[0],
80
+ setShowConfigModal = _useState4[1];
81
+
82
+ var _useState5 = (0, _react.useState)( /*#__PURE__*/_react.default.createElement(Folders, {
83
+ preview: true,
84
+ folders: folders
85
+ })),
86
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
87
+ centerContext = _useState6[0],
88
+ setCenterContext = _useState6[1];
89
+
90
+ var formChanged = function formChanged(values) {
91
+ setCenterContext( /*#__PURE__*/_react.default.createElement(Folders, Object.assign({
92
+ preview: true,
93
+ folders: folders
94
+ }, values)));
95
+ };
67
96
 
68
- default:
69
- break;
97
+ var tabs = [{
98
+ title: 'New',
99
+ id: 'preview'
100
+ }, {
101
+ title: 'Context',
102
+ id: 'community'
103
+ }];
104
+ var sections = [{
105
+ title: 'Styles',
106
+ data: [{
107
+ title: 'Styling',
108
+ component: /*#__PURE__*/_react.default.createElement(_Tabs.default, {
109
+ title: "Folders Config",
110
+ tabs: tabs
111
+ })
112
+ }]
113
+ }];
114
+
115
+ var cancelConfig = function cancelConfig() {
116
+ setShowConfigModal(false);
117
+ localStorage.removeItem('formStyles');
118
+ };
119
+
120
+ var onIconClicked = function onIconClicked(action) {
121
+ if (!props.preview) {
122
+ switch (action) {
123
+ case 'add':
124
+ setShowModal(true);
125
+ break;
126
+
127
+ case 'config':
128
+ setShowConfigModal(true);
129
+ break;
130
+
131
+ default:
132
+ break;
133
+ }
70
134
  }
71
135
  };
72
136
 
@@ -107,7 +171,28 @@ var Folders = function Folders(_ref) {
107
171
  cancelBtnText: "Cancel",
108
172
  saveHandler: onAddFolder,
109
173
  cancelHandler: cancelHandler
110
- })));
174
+ })), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
175
+ modalIsOpen: showConfigModal,
176
+ closeModal: cancelConfig,
177
+ exitModalButton: function exitModalButton(e) {
178
+ return /*#__PURE__*/_react.default.createElement("div", null);
179
+ }
180
+ }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
181
+ title: "Folders Config",
182
+ tabs: tabs
183
+ }, /*#__PURE__*/_react.default.createElement(_FoldersPreview.default, {
184
+ componentProps: {
185
+ folders: folders,
186
+ title: props.title || "Your Folders",
187
+ preview: true
188
+ },
189
+ formChanged: formChanged,
190
+ id: "preview"
191
+ }), /*#__PURE__*/_react.default.createElement(_Community.default, {
192
+ center: centerContext,
193
+ community: community,
194
+ id: "community"
195
+ }))));
111
196
  };
112
197
 
113
198
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: transparent;\n"])));
@@ -19,15 +19,25 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
19
19
 
20
20
  var _ai = require("react-icons/ai");
21
21
 
22
+ var _bs = require("react-icons/bs");
23
+
22
24
  var _ReusableList = _interopRequireDefault(require("../../Reusable Components/ReusableList/ReusableList"));
23
25
 
24
26
  var _ReactModal = _interopRequireDefault(require("../../Reusable Components/ReactModal/ReactModal"));
25
27
 
26
28
  var _CreateFolder = _interopRequireDefault(require("../CreateFolder/CreateFolder"));
27
29
 
30
+ var _Tabs = _interopRequireDefault(require("../../Reusable Components/Tabs/Tabs"));
31
+
32
+ var _Sections = _interopRequireDefault(require("../../Sections/Sections"));
33
+
34
+ var _NotesPreview = _interopRequireDefault(require("../../PreviewComponents/NotesPreview/NotesPreview"));
35
+
36
+ var _Community = _interopRequireDefault(require("../../Reusable Components/Community/Community"));
37
+
28
38
  var _templateObject;
29
39
 
30
- var _excluded = ["notes", "iconColor", "cardTitleFontSize", "cardTitleColor", "cardPadding"];
40
+ var _excluded = ["notes", "iconColor", "cardTitleFontSize", "cardTitleColor", "cardPadding", "community"];
31
41
 
32
42
  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); }
33
43
 
@@ -37,6 +47,10 @@ var listControls = [{
37
47
  icon: /*#__PURE__*/_react.default.createElement(_ai.AiOutlineFileAdd, null),
38
48
  action: 'add',
39
49
  name: 'Add Photo'
50
+ }, {
51
+ icon: /*#__PURE__*/_react.default.createElement(_bs.BsGear, null),
52
+ action: 'config',
53
+ name: 'Config'
40
54
  }];
41
55
  var cardControls = [{
42
56
  icon: /*#__PURE__*/_react.default.createElement(_ai.AiFillDelete, null),
@@ -50,6 +64,7 @@ var Notes = function Notes(_ref) {
50
64
  cardTitleFontSize = _ref.cardTitleFontSize,
51
65
  cardTitleColor = _ref.cardTitleColor,
52
66
  cardPadding = _ref.cardPadding,
67
+ community = _ref.community,
53
68
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
54
69
 
55
70
  var _useState = (0, _react.useState)(false),
@@ -57,14 +72,58 @@ var Notes = function Notes(_ref) {
57
72
  showModal = _useState2[0],
58
73
  setShowModal = _useState2[1];
59
74
 
60
- var onIconClicked = function onIconClicked(action) {
61
- switch (action) {
62
- case 'add':
63
- setShowModal(true);
64
- break;
75
+ var _useState3 = (0, _react.useState)(false),
76
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
77
+ showConfigModal = _useState4[0],
78
+ setShowConfigModal = _useState4[1];
79
+
80
+ var _useState5 = (0, _react.useState)( /*#__PURE__*/_react.default.createElement(Notes, {
81
+ preview: true,
82
+ notes: notes
83
+ })),
84
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
85
+ centerContext = _useState6[0],
86
+ setCenterContext = _useState6[1];
87
+
88
+ var formChanged = function formChanged(values) {
89
+ setCenterContext( /*#__PURE__*/_react.default.createElement(Notes, Object.assign({
90
+ preview: true,
91
+ notes: notes
92
+ }, values)));
93
+ };
94
+
95
+ var tabs = [{
96
+ title: 'New',
97
+ id: 'preview'
98
+ }, {
99
+ title: 'Context',
100
+ id: 'community'
101
+ }];
102
+ var sections = [{
103
+ title: 'Styles',
104
+ data: [{
105
+ title: 'Styling',
106
+ component: /*#__PURE__*/_react.default.createElement(_Tabs.default, {
107
+ title: "Notes Config",
108
+ tabs: tabs
109
+ })
110
+ }]
111
+ }];
65
112
 
66
- default:
67
- break;
113
+ var onIconClicked = function onIconClicked(action) {
114
+ if (!props.preview) {
115
+ switch (action) {
116
+ case 'add':
117
+ setShowModal(true);
118
+ break;
119
+
120
+ case 'config':
121
+ setShowConfigModal(true);
122
+ break;
123
+
124
+ default:
125
+ break;
126
+ }
68
127
  }
69
128
  };
70
129
 
@@ -85,6 +144,11 @@ var Notes = function Notes(_ref) {
85
144
  setShowModal(false);
86
145
  };
87
146
 
147
+ var cancelConfig = function cancelConfig() {
148
+ setShowConfigModal(false);
149
+ localStorage.removeItem('formStyles');
150
+ };
151
+
88
152
  return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_ReusableList.default, Object.assign({
89
153
  listTitle: props.title || "My Notes",
90
154
  data: notes,
@@ -108,7 +172,28 @@ var Notes = function Notes(_ref) {
108
172
  cancelBtnText: props.cancelBtnText || "Cancel",
109
173
  saveHandler: onAddFolder,
110
174
  cancelHandler: cancelHandler
111
- })));
175
+ })), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
176
+ modalIsOpen: showConfigModal,
177
+ closeModal: cancelConfig,
178
+ exitModalButton: function exitModalButton(e) {
179
+ return /*#__PURE__*/_react.default.createElement("div", null);
180
+ }
181
+ }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
182
+ title: "Notes Config",
183
+ tabs: tabs
184
+ }, /*#__PURE__*/_react.default.createElement(_NotesPreview.default, {
185
+ componentProps: {
186
+ notes: notes,
187
+ title: props.title || "Your Notes",
188
+ preview: true
189
+ },
190
+ formChanged: formChanged,
191
+ id: "preview"
192
+ }), /*#__PURE__*/_react.default.createElement(_Community.default, {
193
+ center: centerContext,
194
+ community: community,
195
+ id: "community"
196
+ }))));
112
197
  };
113
198
 
114
199
  var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n"])));
@@ -0,0 +1,54 @@
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 _ReactModal = _interopRequireDefault(require("../../Reusable Components/ReactModal/ReactModal"));
19
+
20
+ var _NavbarPreview = _interopRequireDefault(require("../../PreviewComponents/NavbarPreview/NavbarPreview"));
21
+
22
+ var _Buttons = _interopRequireDefault(require("../../Buttons/Buttons/Buttons"));
23
+
24
+ var _templateObject;
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 SectionedPreview = function SectionedPreview() {
31
+ var _useState = (0, _react.useState)(false),
32
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
33
+ showModal = _useState2[0],
34
+ setShowModal = _useState2[1];
35
+
36
+ return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_Buttons.default, {
37
+ label: 'Open Configurator',
38
+ size: "md",
39
+ variant: "primary",
40
+ buttonClicked: function buttonClicked() {
41
+ setShowModal(true);
42
+ }
43
+ }), /*#__PURE__*/_react.default.createElement(_ReactModal.default, {
44
+ modalIsOpen: showModal,
45
+ closeModal: function closeModal() {
46
+ return setShowModal(false);
47
+ }
48
+ }, /*#__PURE__*/_react.default.createElement(_NavbarPreview.default, null)));
49
+ };
50
+
51
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n"])));
52
+
53
+ var _default = SectionedPreview;
54
+ exports.default = _default;