@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
@@ -5,18 +5,24 @@ import styled from 'styled-components';
5
5
  import Gallery from '../../Reusable Components/Gallery/Gallery';
6
6
  import Modal from '../../Reusable Components/ReactModal/ReactModal';
7
7
  import AddVideo from '../../Forms/AddVideo/AddVideo';
8
+ import Tabs from '../../Reusable Components/Tabs/Tabs';
9
+ import Sections from '../../Sections/Sections'
10
+ import VideoAlbumPreview from '../../PreviewComponents/VideoAlbumPreview/VideoAlbumPreview';
11
+ import Community from '../../Reusable Components/Community/Community';
8
12
 
9
- import { AiFillPlayCircle, AiFillDelete, AiOutlineFileAdd } from "react-icons/ai";
10
13
 
11
14
 
15
+ import { AiFillPlayCircle, AiFillDelete, AiOutlineFileAdd } from "react-icons/ai";
16
+ import { BsGear } from "react-icons/bs";
12
17
 
13
18
  const cardControls = [
14
19
  { icon: (<AiFillPlayCircle />), action: 'play', name: 'play video' },
15
- {icon: (<AiFillDelete />), action: 'delete', name: 'Delete video'}
20
+ { icon: (<AiFillDelete />), action: 'delete', name: 'Delete video' }
16
21
  ]
17
22
 
18
23
  const galleryControls = [
19
24
  { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Add Album' },
25
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
20
26
  ]
21
27
 
22
28
  const ViewAlbum = ({
@@ -25,8 +31,26 @@ const ViewAlbum = ({
25
31
  cardTitleColor,
26
32
  cardTitleFontSize,
27
33
  descColor,
28
- ...props}) => {
34
+ community,
35
+ ...props }) => {
29
36
  const [showModal, setShowModal] = useState(false);
37
+ const [showConfigModal, setShowConfigModal] = useState(false);
38
+ const [centerContext, setCenterContext] = useState(<ViewAlbum preview={true} album={album} />)
39
+
40
+ const formChanged = (values) => {
41
+ console.log('context changed')
42
+ setCenterContext(<ViewAlbum preview={true} album={album} {...values} />)
43
+ }
44
+
45
+ let tabs = [
46
+ {
47
+ title: 'New', id: 'preview'
48
+ },
49
+ {
50
+ title: 'Context', id: 'community'
51
+ }
52
+ ]
53
+
30
54
 
31
55
  const cardStyles = {
32
56
  darkOnHover: true,
@@ -49,12 +73,17 @@ const ViewAlbum = ({
49
73
  }
50
74
 
51
75
  const onHeaderIconClicked = (action) => {
52
- switch (action) {
53
- case 'add':
54
- setShowModal(true)
55
- break;
56
- default:
57
- break;
76
+ if (!props.preview) {
77
+ switch (action) {
78
+ case 'add':
79
+ setShowModal(true)
80
+ break;
81
+ case 'config':
82
+ setShowConfigModal(true)
83
+ break;
84
+ default:
85
+ break;
86
+ }
58
87
  }
59
88
  }
60
89
 
@@ -72,6 +101,11 @@ const ViewAlbum = ({
72
101
  setShowModal(false)
73
102
  }
74
103
 
104
+ const cancelConfig = () => {
105
+ setShowConfigModal(false);
106
+ localStorage.removeItem('formStyles')
107
+ }
108
+
75
109
  return (
76
110
  <Container>
77
111
  <Gallery
@@ -96,6 +130,27 @@ const ViewAlbum = ({
96
130
  saveHandler={onAddVideo}
97
131
  cancelHandler={cancelHandler} />
98
132
  </Modal>
133
+ <Modal
134
+ modalIsOpen={showConfigModal}
135
+ closeModal={cancelConfig}
136
+ exitModalButton={(e) => (
137
+ <div></div>
138
+ )}>
139
+ <Tabs
140
+ title="Video Album Config"
141
+ tabs={tabs}
142
+ id='styling'
143
+ >
144
+ <VideoAlbumPreview
145
+ componentProps={{ album, preview: true }}
146
+ formChanged={formChanged}
147
+ id="preview" />
148
+ <Community
149
+ center={centerContext}
150
+ community={community}
151
+ id="community" />
152
+ </Tabs>
153
+ </Modal>
99
154
  </Container>
100
155
  )
101
156
  }
@@ -5,10 +5,9 @@ import styled from 'styled-components';
5
5
  import AudioPlayer from 'react-h5-audio-player';
6
6
  import 'react-h5-audio-player/lib/styles.css';
7
7
 
8
+ import ReusableHeader from '../../Reusable Components/ReusableHeader/ReusableHeader';
8
9
 
9
-
10
- const MusicPlayerWidget = ({currentSong , ...props}) => {
11
-
10
+ const MusicPlayerWidget = ({ currentSong, ...props }) => {
12
11
 
13
12
  const musicPlayerHeading = (
14
13
  <Header>
@@ -23,9 +22,12 @@ const MusicPlayerWidget = ({currentSong , ...props}) => {
23
22
  </Header>
24
23
  )
25
24
 
26
-
27
-
28
25
  return (
26
+ <Container>
27
+ <ReusableHeader
28
+ title={props.title || 'Music Player'}
29
+ {...props.headerStyles}
30
+ />
29
31
  <MusicPlayer
30
32
  autoPlay='none'
31
33
  src={props.playlist[currentSong].musicSrc}
@@ -37,13 +39,17 @@ const MusicPlayerWidget = ({currentSong , ...props}) => {
37
39
  onClickNext={() => props.nextSong()}
38
40
  {...props}
39
41
  />
42
+ </Container>
40
43
  )
41
44
  }
42
45
 
46
+ const Container = styled.div`
47
+ width: 100%;
48
+ `
43
49
 
44
50
  const MusicPlayer = styled(AudioPlayer)`
45
51
 
46
- font-family: ${props => props.fontFamily || 'inherit'};
52
+ font-family: ${props => props.fontFamily || 'sans-serif'};
47
53
  background-color: ${props => props.backgroundColor || 'transparent'};
48
54
  border-radius: ${props => props.borderRadius ? props.borderRadius + 'px' : 'inherit'};
49
55
  padding: ${props => props.padding ? props.padding + 'px' : 'inherit'}px;
@@ -96,6 +102,7 @@ const Img = styled.img`
96
102
  const MusicName = styled.h3`
97
103
  color: ${props => props.fontColor};
98
104
  font-size: ${props => props.fontSize}px;
105
+ font-weight: 300;
99
106
  `
100
107
 
101
108
  const ArtistName = styled.p`
@@ -0,0 +1,78 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import List from '../../Reusable Components/ReusableList/ReusableList';
4
+
5
+ import { AiOutlineFileAdd } from "react-icons/ai";
6
+ import { BsGear } from "react-icons/bs";
7
+
8
+ import Modal from '../../Reusable Components/ReactModal/ReactModal';
9
+ import SpaceListPreview from '../../PreviewComponents/SpacesListPreview/SpacesListPreview';
10
+ import CreateSpace from '../../Forms/CreateSpace/CreateSpace';
11
+
12
+ const SpacesListWidget = ({
13
+ spaces,
14
+ ...props
15
+ }) => {
16
+ const [showCreateModal, setShowCreateModal] = useState(false)
17
+ const [showConfigModal, setShowConfigModal] = useState(false)
18
+
19
+ const listControls = [
20
+ { icon: (<AiOutlineFileAdd />), action: 'add', name: 'Create Space' },
21
+ { icon: (<BsGear />), action: 'config', name: 'Config' },
22
+ ]
23
+
24
+ const onIconClicked = (action) => {
25
+ if (!props.preview) {
26
+ switch (action) {
27
+ case 'add':
28
+ setShowCreateModal(true)
29
+ break;
30
+ case 'config':
31
+ setShowConfigModal(true)
32
+ break;
33
+ default:
34
+ break;
35
+ }
36
+ }
37
+ }
38
+
39
+ return (
40
+ <Container>
41
+ <List
42
+ listTitle={props.title || 'My Spaces'}
43
+ type='sectioned'
44
+ data={spaces}
45
+ iconClicked={onIconClicked}
46
+ listControls={listControls}
47
+ cardStyle='card-style-3'
48
+ {...props}
49
+ />
50
+ <Modal
51
+ modalIsOpen={showCreateModal}
52
+ closeModal={() => setShowCreateModal(false)}
53
+ exitModalButton={(e) => (
54
+ <div></div>
55
+ )}
56
+ >
57
+ <CreateSpace />
58
+ </Modal>
59
+ <Modal
60
+ modalIsOpen={showConfigModal}
61
+ closeModal={() => setShowConfigModal(false)}
62
+ exitModalButton={(e) => (
63
+ <div></div>
64
+ )}
65
+ >
66
+ <SpaceListPreview
67
+ componentProps={{ spaces, preview: true }}
68
+ />
69
+ </Modal>
70
+ </Container>
71
+ );
72
+ };
73
+
74
+ const Container = styled.div`
75
+
76
+ `
77
+
78
+ export default SpacesListWidget;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import List from '../../Reusable Components/ReusableList/ReusableList';
3
+
4
+ const UsersWidget = ({
5
+ users,
6
+ ...props
7
+ }) => {
8
+
9
+ return (
10
+ <List
11
+ listTitle={props.title || 'Members List'}
12
+ cardStyle="card-style-1"
13
+ data={users}
14
+ type="flat"
15
+ {...props}
16
+ />
17
+ );
18
+ };
19
+
20
+ export default UsersWidget;
@@ -16,13 +16,22 @@ import MusicPlayerWidget from '../Widgets/MusicPlayerWidget/MusicPlayerWidget';
16
16
  import LogoWidget from '../Widgets/LogoWidget/LogoWidget';
17
17
  import VideoPlayer from '../VideoAlbum/VideoPlayer/VideoPlayer';
18
18
  import Notes from '../Library/Notes/Notes';
19
- import Folders from '../Library/Folders/Folders'
20
- // Components
19
+ import Folders from '../Library/Folders/Folders';
20
+ import UsersWidget from '../Widgets/UsersWidget/UsersWidget';
21
+ import SpacesListWidget from '../Widgets/SpacesListWidget/SpacesListWidget';
22
+ // Preview Components
21
23
  import Navbar from '../Navbar/Navbar';
22
24
  import MusicAlbums from '../Music Album/ViewAlbums/ViewAlbums';
23
25
  import MusicAlbum from '../Music Album/ViewAlbum/ViewAlbum';
24
26
  import PhotoAlbums from '../Photo Album/ViewAlbums/ViewAlbums'
25
27
  import PhotoAlbum from '../Photo Album/ViewAlbum/ViewAlbum';
28
+ import MusicPlayer from '../Widgets/MusicPlayerWidget/MusicPlayerWidget';
29
+ import Chat from '../Chat/Chat';
30
+ import Events from '../Events/EventsList/EventsList';
31
+ import Event from '../Events/Event/Event';
32
+ import VideoSpace from '../VideoAlbum/VideoSpace/VideoSpace';
33
+ import VideoAlbums from '../VideoAlbum/AlbumsGallery/AlbumsGallery';
34
+ import VideoAlbum from '../VideoAlbum/ViewAlbum/ViewAlbum';
26
35
 
27
36
  export const stringSearch = (str, word) => {
28
37
  str = str.toUpperCase();
@@ -72,6 +81,9 @@ export const getWidgetType = (widgetType, props, cardClicked) => {
72
81
  'video player': (<VideoPlayer {...props}/>),
73
82
  'notes': (<Notes {...props}/>),
74
83
  'folders': (<Folders {...props}/>),
84
+ 'users': (<UsersWidget {...props}/>),
85
+ 'profile': (<CardStyle2 {...props}/>),
86
+ 'spaces-list': (<SpacesListWidget cardClicked={(path) => cardClicked(path)} {...props}/>),
75
87
  }
76
88
  return widgetTypes[widgetType]
77
89
  }
@@ -83,6 +95,16 @@ export const getComponentType = (componentType, componentProps, stylingProps) =
83
95
  'MusicAlbum': (<MusicAlbum {...componentProps} {...stylingProps}/>),
84
96
  'PhotoAlbum': (<PhotoAlbum {...componentProps} {...stylingProps}/>),
85
97
  'PhotoAlbums': (<PhotoAlbums {...componentProps}{...stylingProps}/>),
98
+ 'MusicPlayer': (<MusicPlayer {...componentProps}{...stylingProps}/>),
99
+ 'Folders': (<Folders {...componentProps}{...stylingProps}/>),
100
+ 'Notes': (<Notes {...componentProps}{...stylingProps}/>),
101
+ 'Spaces-List': (<SpacesListWidget {...componentProps}{...stylingProps}/>),
102
+ 'Chat': (<Chat {...componentProps}{...stylingProps}/>),
103
+ 'Events': (<Events {...componentProps}{...stylingProps}/>),
104
+ 'Event': (<Event {...componentProps}{...stylingProps}/>),
105
+ 'Video-Space': (<VideoSpace {...componentProps}{...stylingProps}/>),
106
+ 'Video-Albums': (<VideoAlbums {...componentProps}{...stylingProps}/>),
107
+ 'Video-Album': (<VideoAlbum {...componentProps}{...stylingProps}/>),
86
108
  }
87
109
  return componentTypes[componentType]
88
110
  }