@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
@@ -3,12 +3,20 @@ import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
6
+ import { BsGear } from "react-icons/bs";
6
7
  import List from '../../Reusable Components/ReusableList/ReusableList';
7
8
  import Modal from '../../Reusable Components/ReactModal/ReactModal';
8
9
  import CreateEvent from '../CreateEvent/CreateEvent';
10
+ import EventsPreview from '../../PreviewComponents/EventsPreview/EventsPreview';
11
+ // import { Events } from './EventsList.stories';
12
+ // import { eventsList } from '../../Pages/Events/Events/Events.stories';
13
+ import Tabs from '../../Reusable Components/Tabs/Tabs';
14
+ import Sections from '../../Sections/Sections';
15
+ import Community from '../../Reusable Components/Community/Community';
9
16
 
10
17
  const listControls = [
11
18
  { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
19
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
12
20
  ]
13
21
 
14
22
  const cardControls = [
@@ -17,31 +25,64 @@ const cardControls = [
17
25
 
18
26
  const EventsList = ({
19
27
  events,
20
- iconColor,
21
- cardTitleFontSize,
22
- cardTitleColor,
23
- cardPadding,
28
+ community,
24
29
  ...props
25
30
  }) => {
26
31
 
27
32
  const [showModal, setShowModal] = useState(false);
33
+ const [showConfigModal, setShowConfigModal] = useState(false);
34
+ const [centerContext, setCenterContext] = useState(<EventsList preview={true} events={events} {...props}/>)
35
+
36
+ const formChanged = (values) => {
37
+ setCenterContext(<EventsList preview={true} events={events} {...values} />)
38
+ }
39
+
40
+ let tabs = [
41
+ {
42
+ title: 'New', id: 'preview'
43
+ },
44
+ {
45
+ title: 'Context', id: 'community'
46
+ }
47
+ ]
48
+
49
+ let sections = [
50
+ {
51
+ title: 'Styles',
52
+ data: [
53
+ {
54
+ title: 'Styling',
55
+ id: 'styling'
56
+ }
57
+ ]
58
+ }
59
+ ]
28
60
 
29
61
  const onIconClicked = (action) => {
30
- switch (action) {
31
- case 'add':
32
- setShowModal(true)
33
- break;
34
- default:
35
- break;
62
+ if (!props.preview) {
63
+ switch (action) {
64
+ case 'add':
65
+ setShowModal(true)
66
+ break;
67
+ case 'config':
68
+ setShowConfigModal(true)
69
+ break;
70
+ default:
71
+ break;
72
+ }
36
73
  }
37
74
  }
38
75
 
39
76
  const cardIconClicked = (action, index) => {
40
- props.cardIconClicked(action, index)
77
+ if (!props.preview) {
78
+ props.cardIconClicked(action, index)
79
+ }
41
80
  }
42
81
 
43
- const cardClicked = () => {
44
- console.log('test')
82
+ const cardClicked = (index, props) => {
83
+ if (!props.preview) {
84
+ props.cardClicked(props)
85
+ }
45
86
  }
46
87
 
47
88
  const cancelHandler = () => {
@@ -53,6 +94,11 @@ const EventsList = ({
53
94
  props.onAddEvent(event)
54
95
  }
55
96
 
97
+ const cancelConfig = () => {
98
+ setShowConfigModal(false);
99
+ localStorage.removeItem('formStyles')
100
+ }
101
+
56
102
  return (
57
103
  <Container>
58
104
  <List
@@ -80,6 +126,44 @@ const EventsList = ({
80
126
  cancelHandler={cancelHandler}
81
127
  />
82
128
  </Modal>
129
+ <Modal
130
+ modalIsOpen={showConfigModal}
131
+ closeModal={cancelConfig}
132
+ exitModalButton={(e) => (
133
+ <div></div>
134
+ )}
135
+ >
136
+ {/* <Sections
137
+ sections={sections}
138
+ backgroundColor={'white'}
139
+ sectionHeaderStyles={{
140
+ titleColor: 'white',
141
+ headerBackground: 'transparent'
142
+ }}
143
+ customCardStyles={{
144
+ cardPadding: 6,
145
+ cardTitleFontSize: 15,
146
+ cardBackgroundColor: '#2c2c2c',
147
+ cardTitleColor: 'white',
148
+ onHoverBackgroundColor: '#555555',
149
+ controlsStyles: {
150
+ showOnHover: true,
151
+ }
152
+ }} /> */}
153
+ <Tabs
154
+ title="Events Config"
155
+ tabs={tabs}>
156
+ <EventsPreview
157
+ componentProps={{ events, title: props.title || "My Events", preview: true }}
158
+ formChanged={formChanged}
159
+ id='preview'
160
+ />
161
+ <Community
162
+ center={centerContext}
163
+ community={community}
164
+ id="community" />
165
+ </Tabs>
166
+ </Modal>
83
167
  </Container>
84
168
  )
85
169
  }
@@ -93,14 +177,11 @@ EventsList.defaultProps = {};
93
177
  EventsList.propTypes = {
94
178
  notes: PropTypes.array.isRequired,
95
179
  title: PropTypes.string,
96
- iconColor: PropTypes.string,
97
- cardTitleFontSize: PropTypes.number,
98
- cardTitleColor: PropTypes.string,
99
- cardPadding: PropTypes.number,
100
180
  headerStyles: PropTypes.object,
101
181
  customCardStyles: PropTypes.object,
102
182
  saveBtnText: PropTypes.string,
103
183
  cancelBtnText: PropTypes.string,
184
+ preview: PropTypes.bool
104
185
  }
105
186
 
106
187
  export default EventsList
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import * as Yup from 'yup';
4
+ import styled from 'styled-components';
5
+
6
+ import ReusableForm from '../../Reusable Components/ReusableForm/ReusableForm';
7
+ import TextField from '../../Common Inputs/TextField/TextField';
8
+
9
+ const CreateSpace = (props) => {
10
+
11
+ const initialValues = {
12
+ title: ''
13
+ }
14
+
15
+ const formSchema = Yup.object().shape({
16
+ title: Yup.string()
17
+ .required("Required"),
18
+ });
19
+
20
+ const sections = [
21
+ {
22
+ title: "Space Details",
23
+ body: [
24
+ (<TextField label="Title" name="title" />),
25
+ ],
26
+ hideTitle: false
27
+ },
28
+ ]
29
+
30
+ const onCreate = (values) => {
31
+ props.saveHandler(values)
32
+ }
33
+
34
+ const cancelHandler = () => {
35
+ props.cancelHandler()
36
+ }
37
+ return (
38
+ <Container>
39
+ <ReusableForm
40
+ formTitle={props.title || "Create Space"}
41
+ initialValues={initialValues}
42
+ formSchema={formSchema}
43
+ sections={sections}
44
+ saveBtnText={props.saveBtnText || 'Create'}
45
+ cancelBtnText={props.cancelBtnText || 'Cancel'}
46
+ saveHandler={onCreate}
47
+ cancelHandler={cancelHandler}
48
+ headerStyles={{
49
+ padding: 10,
50
+ headerBackground: 'black',
51
+ titleColor: '#ffff',
52
+ }}
53
+ sectionPadding={10}
54
+ bodyRowGap={10}
55
+ {...props.formStyles}
56
+ />
57
+ </Container>
58
+ );
59
+ };
60
+
61
+ const Container = styled.div`
62
+
63
+ `
64
+
65
+ CreateSpace.defaultProps = {};
66
+
67
+ CreateSpace.propTypes = {
68
+ title: PropTypes.string,
69
+ saveBtnText: PropTypes.string,
70
+ cancelBtnText: PropTypes.string
71
+ }
72
+
73
+ export default CreateSpace;
@@ -2,13 +2,21 @@ import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
5
+ import { BsGear } from "react-icons/bs";
5
6
 
6
7
  import Gallery from '../../Reusable Components/Gallery/Gallery';
7
8
  import Modal from '../../Reusable Components/ReactModal/ReactModal';
8
9
  import CreateFolder from '../CreateFolder/CreateFolder';
10
+ import Tabs from '../../Reusable Components/Tabs/Tabs';
11
+ import Sections from '../../Sections/Sections'
12
+ import FoldersPreview from '../../PreviewComponents/FoldersPreview/FoldersPreview';
13
+ // import { Folders as Context } from '../../Pages/Library/Folders/Library.stories';
14
+ // import { ViewFolders } from './Folders.stories';
15
+ import Community from '../../Reusable Components/Community/Community';
9
16
 
10
17
  const galleryControls = [
11
18
  { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
19
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
12
20
  ]
13
21
 
14
22
  const cardControls = [
@@ -23,17 +31,57 @@ const Folders = ({
23
31
  rowGap,
24
32
  cardClicked,
25
33
  iconColor,
34
+ community,
26
35
  ...props
27
36
  }) => {
28
37
  const [showModal, setShowModal] = useState(false);
38
+ const [showConfigModal, setShowConfigModal] = useState(false);
39
+ const [centerContext, setCenterContext] = useState(<Folders preview={true} folders={folders} />)
40
+
41
+ const formChanged = (values) => {
42
+ setCenterContext(<Folders preview={true} folders={folders} {...values} />)
43
+ }
44
+
45
+ let tabs = [
46
+ {
47
+ title: 'New', id: 'preview'
48
+ },
49
+ {
50
+ title: 'Context', id: 'community'
51
+ }
52
+ ]
53
+
54
+ const sections = [
55
+ {
56
+ title: 'Styles',
57
+ data: [
58
+ {
59
+ title: 'Styling', component: (<Tabs
60
+ title="Folders Config"
61
+ tabs={tabs}
62
+ />)
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+
68
+ const cancelConfig = () => {
69
+ setShowConfigModal(false);
70
+ localStorage.removeItem('formStyles')
71
+ }
29
72
 
30
73
  const onIconClicked = (action) => {
31
- switch (action) {
32
- case 'add':
33
- setShowModal(true)
34
- break;
35
- default:
36
- break;
74
+ if (!props.preview) {
75
+ switch (action) {
76
+ case 'add':
77
+ setShowModal(true)
78
+ break;
79
+ case 'config':
80
+ setShowConfigModal(true)
81
+ break;
82
+ default:
83
+ break;
84
+ }
37
85
  }
38
86
  }
39
87
 
@@ -69,7 +117,8 @@ const Folders = ({
69
117
  closeModal={() => setShowModal(false)}
70
118
  exitModalButton={(e) => (
71
119
  <div></div>
72
- )}>
120
+ )}
121
+ >
73
122
  <CreateFolder
74
123
  saveBtnText="Create"
75
124
  cancelBtnText="Cancel"
@@ -77,6 +126,44 @@ const Folders = ({
77
126
  cancelHandler={cancelHandler}
78
127
  />
79
128
  </Modal>
129
+ <Modal
130
+ modalIsOpen={showConfigModal}
131
+ closeModal={cancelConfig}
132
+ exitModalButton={(e) => (
133
+ <div></div>
134
+ )}
135
+ >
136
+ {/* <Sections
137
+ sections={sections}
138
+ backgroundColor={'white'}
139
+ sectionHeaderStyles={{
140
+ titleColor: 'white',
141
+ headerBackground: 'transparent'
142
+ }}
143
+ customCardStyles={{
144
+ cardPadding: 6,
145
+ cardTitleFontSize: 15,
146
+ cardBackgroundColor: '#2c2c2c',
147
+ cardTitleColor: 'white',
148
+ onHoverBackgroundColor: '#555555',
149
+ controlsStyles: {
150
+ showOnHover: true,
151
+ }
152
+ }} /> */}
153
+ <Tabs
154
+ title="Folders Config"
155
+ tabs={tabs}>
156
+ <FoldersPreview
157
+ componentProps={{ folders, title: props.title || "Your Folders", preview: true }}
158
+ formChanged={formChanged}
159
+ id='preview'
160
+ />
161
+ <Community
162
+ center={centerContext}
163
+ community={community}
164
+ id="community" />
165
+ </Tabs>
166
+ </Modal>
80
167
  </Container>
81
168
  )
82
169
  }
@@ -3,13 +3,18 @@ import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  import { AiOutlineFileAdd, AiFillDelete } from "react-icons/ai";
6
+ import { BsGear } from "react-icons/bs";
6
7
  import List from '../../Reusable Components/ReusableList/ReusableList';
7
8
  import Modal from '../../Reusable Components/ReactModal/ReactModal';
8
9
  import CreateFolder from '../CreateFolder/CreateFolder';
9
-
10
+ import Tabs from '../../Reusable Components/Tabs/Tabs';
11
+ import Sections from '../../Sections/Sections'
12
+ import NotesPreview from '../../PreviewComponents/NotesPreview/NotesPreview';
13
+ import Community from '../../Reusable Components/Community/Community';
10
14
 
11
15
  const listControls = [
12
16
  { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Photo' },
17
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
13
18
  ]
14
19
 
15
20
  const cardControls = [
@@ -22,17 +27,52 @@ const Notes = ({
22
27
  cardTitleFontSize,
23
28
  cardTitleColor,
24
29
  cardPadding,
30
+ community,
25
31
  ...props
26
32
  }) => {
27
33
  const [showModal, setShowModal] = useState(false);
34
+ const [showConfigModal, setShowConfigModal] = useState(false);
35
+ const [centerContext, setCenterContext] = useState(<Notes preview={true} notes={notes} />)
36
+
37
+ const formChanged = (values) => {
38
+ setCenterContext(<Notes preview={true} notes={notes} {...values} />)
39
+ }
40
+
41
+ let tabs = [
42
+ {
43
+ title: 'New', id: 'preview'
44
+ },
45
+ {
46
+ title: 'Context', id: 'community'
47
+ }
48
+ ]
49
+
50
+ const sections = [
51
+ {
52
+ title: 'Styles',
53
+ data: [
54
+ {
55
+ title: 'Styling', component: (<Tabs
56
+ title="Notes Config"
57
+ tabs={tabs}
58
+ />)
59
+ }
60
+ ]
61
+ }
62
+ ]
28
63
 
29
64
  const onIconClicked = (action) => {
30
- switch (action) {
31
- case 'add':
32
- setShowModal(true)
33
- break;
34
- default:
35
- break;
65
+ if (!props.preview) {
66
+ switch (action) {
67
+ case 'add':
68
+ setShowModal(true)
69
+ break;
70
+ case 'config':
71
+ setShowConfigModal(true)
72
+ break;
73
+ default:
74
+ break;
75
+ }
36
76
  }
37
77
  }
38
78
 
@@ -53,6 +93,11 @@ const Notes = ({
53
93
  setShowModal(false)
54
94
  }
55
95
 
96
+ const cancelConfig = () => {
97
+ setShowConfigModal(false);
98
+ localStorage.removeItem('formStyles')
99
+ }
100
+
56
101
  return (
57
102
  <Container>
58
103
  <List
@@ -80,6 +125,27 @@ const Notes = ({
80
125
  cancelHandler={cancelHandler}
81
126
  />
82
127
  </Modal>
128
+ <Modal
129
+ modalIsOpen={showConfigModal}
130
+ closeModal={cancelConfig}
131
+ exitModalButton={(e) => (
132
+ <div></div>
133
+ )}
134
+ >
135
+ <Tabs
136
+ title="Notes Config"
137
+ tabs={tabs}>
138
+ <NotesPreview
139
+ componentProps={{ notes, title: props.title || "Your Notes" , preview: true}}
140
+ formChanged={formChanged}
141
+ id="preview"
142
+ />
143
+ <Community
144
+ center={centerContext}
145
+ community={community}
146
+ id="community" />
147
+ </Tabs>
148
+ </Modal>
83
149
  </Container>
84
150
  )
85
151
  }
@@ -0,0 +1,31 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import Modal from '../../Reusable Components/ReactModal/ReactModal';
4
+
5
+ import NavbarPreview from '../../PreviewComponents/NavbarPreview/NavbarPreview';
6
+ import Button from '../../Buttons/Buttons/Buttons';
7
+
8
+ const SectionedPreview = () => {
9
+ const [showModal, setShowModal] = useState(false);
10
+ return (
11
+ <Container>
12
+ <Button
13
+ label={'Open Configurator'}
14
+ size="md"
15
+ variant="primary"
16
+ buttonClicked={() => { setShowModal(true) }}
17
+ />
18
+ <Modal
19
+ modalIsOpen={showModal}
20
+ closeModal={() => setShowModal(false)}>
21
+ <NavbarPreview />
22
+ </Modal>
23
+ </Container>
24
+ );
25
+ };
26
+
27
+ const Container = styled.div`
28
+
29
+ `
30
+
31
+ export default SectionedPreview;
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
@@ -6,10 +6,19 @@ import List from '../../Reusable Components/ReusableList/ReusableList';
6
6
  import Modal from '../../Reusable Components/ReactModal/ReactModal';
7
7
 
8
8
  import { AiOutlineFileAdd, AiOutlineDelete } from "react-icons/ai";
9
+ import { BsGear } from "react-icons/bs";
9
10
  import AddSong from '../../Forms/AddSong/AddSong';
11
+ import Tabs from '../../Reusable Components/Tabs/Tabs';
12
+ import Sections from '../../Sections/Sections';
13
+ import MusicAlbumPreview from '../../PreviewComponents/MusicAlbumPreview/MusicAlbumPreview';
14
+ import WidgetContainer from "../../Reusable Components/WidgetContainer/WidgetContainer";
15
+ import Community from '../../Reusable Components/Community/Community';
16
+ import { SPACES } from '../../Pages/ViewWorld/constatnts';
17
+ // import styles from '../../styling.json'
10
18
 
11
19
  const listControls = [
12
20
  { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
21
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
13
22
  ]
14
23
 
15
24
  const cardControls = [
@@ -20,22 +29,58 @@ const ViewAlbum = ({
20
29
  album,
21
30
  cardBackgroundColor,
22
31
  songTitleColor,
32
+ community,
23
33
  ...props }) => {
24
- const [showModal, setShowModal] = useState(false)
34
+ const [showModal, setShowModal] = useState(false);
35
+ const [showConfigModal, setShowConfigModal] = useState(false);
36
+ const [centerContext, setCenterContext] = useState(<ViewAlbum preview={true} album={album} />)
25
37
 
26
- const onIconClicked = (action) => {
27
- switch (action) {
28
- case 'add':
29
- setShowModal(true)
30
- break;
38
+ const formChanged = (values) => {
39
+ console.log('context changed')
40
+ setCenterContext(<ViewAlbum preview={true} album={album} {...values} />)
41
+ }
42
+
43
+
44
+ let tabs = [
45
+ {
46
+ title: 'New', id: 'preview'
47
+ },
48
+ {
49
+ title: 'Context', id: 'community'
50
+ }
51
+ ]
52
+
53
+ let sections = [
54
+ {
55
+ title: 'Styles',
56
+ data: [
57
+ {
58
+ title: 'Styling',
59
+ id: 'styling'
60
+ }
61
+ ]
62
+ }
63
+ ]
31
64
 
32
- default:
33
- break;
65
+ const onIconClicked = (action) => {
66
+ if (!props.preview) {
67
+ switch (action) {
68
+ case 'add':
69
+ setShowModal(true)
70
+ break;
71
+ case 'config':
72
+ setShowConfigModal(true)
73
+ break;
74
+ default:
75
+ break;
76
+ }
34
77
  }
35
78
  }
36
79
 
37
80
  const cardIconClicked = (action, index) => {
38
- props.cardIconClicked(action, index)
81
+ if (!props.preview) {
82
+ props.cardIconClicked(action, index)
83
+ }
39
84
  }
40
85
 
41
86
  const onAddSong = (song) => {
@@ -73,6 +118,30 @@ const ViewAlbum = ({
73
118
  saveBtnText={props.saveBtnText || "Create"}
74
119
  cancelBtnText={props.cancelBtnText || "Cancel"} />
75
120
  </Modal>
121
+ <Modal
122
+ modalIsOpen={showConfigModal}
123
+ closeModal={() => {
124
+ localStorage.removeItem('formStyles')
125
+ setShowConfigModal(false)
126
+ }}
127
+ exitModalButton={(e) => (
128
+ <div></div>
129
+ )}
130
+ >
131
+ <Tabs
132
+ title="Album Config"
133
+ tabs={tabs}>
134
+ <MusicAlbumPreview
135
+ componentProps={{ album, title: props.title || "My Album", preview: true }}
136
+ formChanged={formChanged}
137
+ id="preview"
138
+ />
139
+ <Community
140
+ center={centerContext}
141
+ community={community}
142
+ id="community" />
143
+ </Tabs>
144
+ </Modal>
76
145
  </Container>
77
146
  )
78
147
  }
@@ -82,7 +151,7 @@ const Container = styled.div`
82
151
  `
83
152
 
84
153
  ViewAlbum.defaultProps = {
85
-
154
+
86
155
  };
87
156
 
88
157
  ViewAlbum.propTypes = {
@@ -97,6 +166,7 @@ ViewAlbum.propTypes = {
97
166
  cancelBtnText: PropTypes.string,
98
167
  headerStyles: PropTypes.object,
99
168
  customCardStyles: PropTypes.object,
169
+ preview: PropTypes.bool
100
170
  };
101
171
 
102
172
  export default ViewAlbum