@plusscommunities/pluss-core-web 1.7.3-beta.0 → 1.7.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/.babelrc +3 -0
  2. package/dist/components.js +390 -33094
  3. package/dist/components.js.map +1 -1
  4. package/dist/index.cjs.js +10388 -0
  5. package/dist/index.esm.js +10349 -0
  6. package/dist/index.js +394 -33098
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.umd.js +10361 -0
  9. package/package.json +31 -22
  10. package/rollup.config.js +57 -0
  11. package/src/actions/AuthActions.js +83 -0
  12. package/src/actions/LocalActions.js +8 -0
  13. package/src/actions/NavActions.js +8 -0
  14. package/src/actions/ScheduledActionsActions.js +8 -0
  15. package/src/actions/TemplateActions.js +15 -0
  16. package/src/actions/UsersActions.js +95 -0
  17. package/src/actions/index.js +6 -0
  18. package/src/actions/types.js +23 -0
  19. package/src/analytics.js +183 -0
  20. package/src/apis/analyticsActions.js +53 -0
  21. package/src/apis/authActions.js +58 -0
  22. package/src/apis/fileActions.js +152 -0
  23. package/src/apis/index.js +10 -0
  24. package/src/apis/profileActions.js +133 -0
  25. package/src/apis/scheduledActionsActions.js +12 -0
  26. package/src/apis/stringActions.js +25 -0
  27. package/src/apis/templateActions.js +41 -0
  28. package/src/apis/typeActions.js +186 -0
  29. package/src/apis/userActions.js +169 -0
  30. package/src/apis/utilityActions.js +35 -0
  31. package/src/colours.js +134 -0
  32. package/src/components/AddButton.js +27 -0
  33. package/src/components/AnalyticsFilter.js +115 -0
  34. package/src/components/Attachment.js +27 -0
  35. package/src/components/AudienceIncluder.js +175 -0
  36. package/src/components/AudienceSelector.js +700 -0
  37. package/src/components/Button.js +66 -0
  38. package/src/components/CheckBox.js +77 -0
  39. package/src/components/ColourOptions.js +197 -0
  40. package/src/components/ColourPicker.js +267 -0
  41. package/src/components/Comment.js +46 -0
  42. package/src/components/CommentSection.js +116 -0
  43. package/src/components/DatePicker.js +290 -0
  44. package/src/components/DropdownInput.js +223 -0
  45. package/src/components/DurationInput.js +51 -0
  46. package/src/components/ExportCsvPopup.js +222 -0
  47. package/src/components/FileInput.js +389 -0
  48. package/src/components/GenericInput.js +169 -0
  49. package/src/components/Header.js +82 -0
  50. package/src/components/HubSidebar.js +134 -0
  51. package/src/components/ImageInput.js +987 -0
  52. package/src/components/InputGroup.js +18 -0
  53. package/src/components/MakerPopup.js +310 -0
  54. package/src/components/MoreMenu.js +22 -0
  55. package/src/components/OptionsSection.js +84 -0
  56. package/src/components/OverlayPage.js +74 -0
  57. package/src/components/OverlayPageBottomButtons.js +48 -0
  58. package/src/components/OverlayPageContents.js +48 -0
  59. package/src/components/OverlayPageSection.js +38 -0
  60. package/src/components/P60Icon.js +40 -0
  61. package/src/components/PageTitle.js +13 -0
  62. package/src/components/Popup.js +104 -0
  63. package/src/components/ProfilePic.js +50 -0
  64. package/src/components/RadioButton.js +144 -0
  65. package/src/components/Reactions.js +77 -0
  66. package/src/components/SVGIcon.js +33 -0
  67. package/src/components/SideNavItem.js +98 -0
  68. package/src/components/StatBox.js +49 -0
  69. package/src/components/StatusButton.js +22 -0
  70. package/src/components/SuccessPopup.js +57 -0
  71. package/src/components/Tabs.js +56 -0
  72. package/src/components/Tag.js +62 -0
  73. package/src/components/Text.js +20 -0
  74. package/src/components/TextFormatPopup.js +54 -0
  75. package/src/components/TimePicker.js +225 -0
  76. package/src/components/UserListing.js +111 -0
  77. package/src/components/index.js +46 -0
  78. package/src/components/svg-icons.json +821 -0
  79. package/src/config.js +25 -0
  80. package/src/helper/HelpDeskWidget.js +16 -0
  81. package/src/helper/api/getUrl.js +15 -0
  82. package/src/helper/api/getUrlParams.js +9 -0
  83. package/src/helper/api/safeReadParams.js +6 -0
  84. package/src/helper/auth/getUserFromState.js +8 -0
  85. package/src/helper/colours/getAppColourFromState.js +10 -0
  86. package/src/helper/files/canvasImageUploader.js +159 -0
  87. package/src/helper/files/generateImageName.js +10 -0
  88. package/src/helper/files/get1400.js +32 -0
  89. package/src/helper/files/getExtension.js +9 -0
  90. package/src/helper/files/getFileName.js +13 -0
  91. package/src/helper/files/getThumb300.js +36 -0
  92. package/src/helper/files/isVideo.js +8 -0
  93. package/src/helper/helper.js +97 -0
  94. package/src/helper/index.js +44 -0
  95. package/src/helper/site/getMerchantsFromState.js +9 -0
  96. package/src/helper/site/getSiteLevelFromState.js +34 -0
  97. package/src/helper/site/getSiteName.js +16 -0
  98. package/src/helper/site/getSiteNameFromRoles.js +12 -0
  99. package/src/helper/site/getSiteSettingFromState.js +10 -0
  100. package/src/helper/storage/readJSONFromStorage.js +9 -0
  101. package/src/helper/storage/readStorageWithCookie.js +22 -0
  102. package/src/helper/storage/setLocalStorage.js +5 -0
  103. package/src/helper/strings/getFirstName.js +10 -0
  104. package/src/helper/strings/htmlDecode.js +4 -0
  105. package/src/helper/strings/htmlEncode.js +4 -0
  106. package/src/helper/strings/isEmail.js +11 -0
  107. package/src/helper/strings/isUrl.js +13 -0
  108. package/src/helper/strings/onlyAlphanumeric.js +8 -0
  109. package/src/helper/strings/randomString.js +10 -0
  110. package/src/helper/strings/toParagraphed.js +17 -0
  111. package/src/index.js +12 -0
  112. package/src/reducers/ScheduledActionsReducer.js +14 -0
  113. package/src/reducers/TemplatesReducer.js +29 -0
  114. package/src/reducers/index.js +7 -0
  115. package/src/session.js +289 -0
  116. package/src/urls.js +21 -0
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { FormGroup, FormControl, FormLabel, FormText } from 'react-bootstrap';
3
+ import { COLOUR_RED } from '../colours';
4
+
5
+ function InputGroup({ id, label, help, showError, required, ...props }) {
6
+ return (
7
+ <FormGroup controlId={id} validationState={showError ? 'error' : null}>
8
+ <FormLabel>
9
+ <span>{label}</span>
10
+ {required && <span style={{ color: COLOUR_RED, marginLeft: 5 }}>*</span>}
11
+ </FormLabel>
12
+ <FormControl {...props} />
13
+ {help && <FormText>{help}</FormText>}
14
+ </FormGroup>
15
+ );
16
+ }
17
+
18
+ export { InputGroup };
@@ -0,0 +1,310 @@
1
+ import React, { Component } from 'react';
2
+ import { connect } from 'react-redux';
3
+ import Lottie from 'react-lottie';
4
+ import _ from 'lodash';
5
+ import { unauthedFunction } from '../session';
6
+ import { Popup } from './Popup';
7
+ import { GenericInput } from './GenericInput';
8
+ import { Text } from './Text';
9
+ import { Button } from './Button';
10
+ import { DropdownInput } from './DropdownInput';
11
+ import { typeActions, utilityActions } from '../apis';
12
+ import Config from '../config';
13
+ import { COLOUR_BRANDING_APP } from '../colours';
14
+ import { getPluralOptions } from '../helper';
15
+
16
+ class MakerPopup extends Component {
17
+ constructor(props) {
18
+ super(props);
19
+
20
+ this.sizes = [
21
+ { Key: 'A3', Title: 'A3' },
22
+ { Key: 'A4', Title: 'A4' },
23
+ { Key: 'A5', Title: 'A5' },
24
+ ];
25
+ this.formats = [
26
+ { Key: 'pdf', Title: 'PDF' },
27
+ { Key: 'png', Title: 'PNG' },
28
+ { Key: 'jpg', Title: 'JPEG' },
29
+ ];
30
+
31
+ this.lottieAnimationUrl =
32
+ 'https://pluss-prd-media.s3-ap-southeast-2.amazonaws.com/assets/lottie-layout.json';
33
+
34
+ this.state = {
35
+ ...this.props.initialData,
36
+ logo: null,
37
+ colour: null,
38
+ submitting: false,
39
+ loadingBranding: true,
40
+ asset: null,
41
+ selectedSize: 'A4',
42
+ selectedFormat: 'pdf',
43
+ lottieConfig: {
44
+ loop: true,
45
+ autoplay: true,
46
+ name: 'lottie-layout',
47
+ },
48
+ };
49
+ }
50
+
51
+ componentDidMount() {
52
+ this.getBranding();
53
+ this.getLottieConfig();
54
+ }
55
+
56
+ getBranding() {
57
+ typeActions.getSiteBranding(this.props.auth.site).then((res) => {
58
+ console.log(res.data);
59
+ this.setState({
60
+ loadingBranding: false,
61
+ siteName: res.data.Name,
62
+ colour: res.data.MainBrandingColour || COLOUR_BRANDING_APP,
63
+ logo: res.data.Logo || Config.env.logo,
64
+ headerType: res.data.HeaderType || 'white',
65
+ });
66
+ });
67
+ }
68
+
69
+ getLottieConfig() {
70
+ unauthedFunction({
71
+ method: 'GET',
72
+ url: this.lottieAnimationUrl,
73
+ }).then((res) => {
74
+ this.setState({
75
+ lottieConfig: {
76
+ ...this.state.lottieConfig,
77
+ animationData: res.data,
78
+ },
79
+ });
80
+ });
81
+ }
82
+
83
+ handleChange(key, value) {
84
+ this.setState({ [key]: value });
85
+ }
86
+
87
+ selectSize = (size) => {
88
+ this.setState({
89
+ selectedSize: size,
90
+ });
91
+ };
92
+
93
+ getSelectedSizeTitle = () => {
94
+ return _.find(this.sizes, (f) => {
95
+ return f.Key === this.state.selectedSize;
96
+ }).Title;
97
+ };
98
+
99
+ selectFormat = (format) => {
100
+ this.setState({
101
+ selectedFormat: format,
102
+ });
103
+ };
104
+
105
+ getSelectedFormatTitle = () => {
106
+ return _.find(this.formats, (f) => {
107
+ return f.Key === this.state.selectedFormat;
108
+ }).Title;
109
+ };
110
+
111
+ compileData = () => {
112
+ const result = {};
113
+ this.props.inputs.forEach((input) => {
114
+ result[input.key] = this.state[input.key];
115
+ });
116
+ result.colour = this.state.colour;
117
+ result.logo = this.state.logo;
118
+ result.headerType = this.state.headerType;
119
+ return { ...result, ...this.props.requestData };
120
+ };
121
+
122
+ compileRequestData = () => {
123
+ const result = {};
124
+
125
+ if (!this.props.hideFormat) {
126
+ result.format = this.state.selectedFormat;
127
+ }
128
+ if (!this.props.hideSize) {
129
+ result.size = this.state.selectedSize;
130
+ }
131
+ return { ...result, ...this.props.requestData, data: this.compileData() };
132
+ };
133
+
134
+ isReadyToSubmit = () => {
135
+ if (this.state.loadingBranding) {
136
+ return false;
137
+ }
138
+ if (this.state.submitting) {
139
+ return false;
140
+ }
141
+ return true;
142
+ };
143
+
144
+ onGenerateAsset = () => {
145
+ if (!this.isReadyToSubmit()) {
146
+ return;
147
+ }
148
+ const data = this.compileRequestData();
149
+ this.setState({
150
+ submitting: true,
151
+ });
152
+
153
+ utilityActions
154
+ .generateMake(this.props.templateId, data)
155
+ .then((res) => {
156
+ this.setState({
157
+ submitting: false,
158
+ asset: res.data.resultUrl,
159
+ });
160
+ })
161
+ .catch((err) => {
162
+ this.setState({
163
+ submitting: false,
164
+ });
165
+ });
166
+ };
167
+
168
+ downloadAsset = () => {
169
+ window.open(this.state.asset, '_blank');
170
+ };
171
+
172
+ getButtons() {
173
+ if (this.state.submitting) {
174
+ return [];
175
+ }
176
+ if (this.state.asset) {
177
+ return [
178
+ {
179
+ type: 'tertiary',
180
+ onClick: this.props.onClose,
181
+ isActive: true,
182
+ text: 'Done',
183
+ },
184
+ ];
185
+ }
186
+ return [
187
+ {
188
+ type: 'primary',
189
+ onClick: this.onGenerateAsset,
190
+ isActive: this.isReadyToSubmit(),
191
+ text: 'Create',
192
+ },
193
+ {
194
+ type: 'tertiary',
195
+ onClick: this.props.onClose,
196
+ isActive: true,
197
+ text: 'Cancel',
198
+ },
199
+ ];
200
+ }
201
+
202
+ renderInput(input) {
203
+ if (input.type === 'array') {
204
+ return (
205
+ <div className="marginTop-16">
206
+ <Text type="formLabel">{input.title}</Text>
207
+ <Text type="body">
208
+ {this.state[input.key].length} {getPluralOptions(this.state[input.key].length, 'entry', 'entries')}
209
+ </Text>
210
+ </div>
211
+ );
212
+ }
213
+ return (
214
+ <GenericInput
215
+ key={input.key}
216
+ id={`maker_${input.key}`}
217
+ type={input.type}
218
+ label={input.title}
219
+ value={this.state[input.key]}
220
+ onChange={(e) => this.setState({ [input.key]: e.target.value })}
221
+ alwaysShowLabel
222
+ disabled={input.readOnly}
223
+ placeholder={input.placeholder}
224
+ />
225
+ );
226
+ }
227
+
228
+ renderContent() {
229
+ if (this.state.submitting) {
230
+ return (
231
+ <div className="flex flex-column flex-center">
232
+ {this.state.lottieConfig.animationData && (
233
+ <Lottie
234
+ key="lottie-layout"
235
+ height={260}
236
+ width={260}
237
+ options={this.state.lottieConfig}
238
+ isClickToPauseDisabled
239
+ />
240
+ )}
241
+ <Text type="h3" className="marginTop-16">
242
+ Generating
243
+ </Text>
244
+ </div>
245
+ );
246
+ }
247
+ if (this.state.asset) {
248
+ return (
249
+ <div>
250
+ <Text type="h4">Your file is ready</Text>
251
+ <Button leftIcon="download" buttonType="primary" onClick={this.downloadAsset} isActive className="marginTop-16">
252
+ Download
253
+ </Button>
254
+ </div>
255
+ );
256
+ }
257
+ return (
258
+ <div>
259
+ {!this.props.hideSize && (
260
+ <DropdownInput
261
+ id="size"
262
+ label="Size"
263
+ placeholder="Size"
264
+ value={this.getSelectedSizeTitle()}
265
+ options={this.sizes}
266
+ onSelect={this.selectSize}
267
+ />
268
+ )}
269
+ {!this.props.hideFormat && (
270
+ <DropdownInput
271
+ id="format"
272
+ label="Format"
273
+ placeholder="Format"
274
+ value={this.getSelectedFormatTitle()}
275
+ options={this.formats}
276
+ onSelect={this.selectFormat}
277
+ />
278
+ )}
279
+ {this.props.inputs.map((input) => {
280
+ return this.renderInput(input);
281
+ })}
282
+ </div>
283
+ );
284
+ }
285
+
286
+ render() {
287
+ return (
288
+ <Popup
289
+ title={this.props.title}
290
+ buttons={this.getButtons()}
291
+ onClose={this.props.onClose}
292
+ hasPadding
293
+ minWidth={this.props.minWidth}
294
+ maxWidth={this.props.maxWidth}
295
+ minHeight={this.props.minHeight}
296
+ maxHeight={this.props.maxHeight}
297
+ >
298
+ {this.renderContent()}
299
+ </Popup>
300
+ );
301
+ }
302
+ }
303
+
304
+ const mapStateToProps = (state) => {
305
+ return { auth: state.auth };
306
+ };
307
+
308
+ let exportObj = connect(mapStateToProps, {})(MakerPopup);
309
+
310
+ export { exportObj as MakerPopup };
@@ -0,0 +1,22 @@
1
+ import React, { Component } from 'react';
2
+
3
+ class MoreMenu extends Component {
4
+ render() {
5
+ return (
6
+ <div className="moreMenu">
7
+ {this.props.options.map((ev, index) => {
8
+ if (ev != null) {
9
+ return (
10
+ <div className="moreMenu_option" key={ev.key} onClick={ev.onPress}>
11
+ {ev.text}
12
+ </div>
13
+ );
14
+ }
15
+ return null;
16
+ })}
17
+ </div>
18
+ );
19
+ }
20
+ }
21
+
22
+ export { MoreMenu };
@@ -0,0 +1,84 @@
1
+ import React, { Component } from 'react';
2
+ import _ from 'lodash';
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import { COLOUR_BRANDING_MAIN } from '../colours';
5
+ import { SVGIcon } from './SVGIcon';
6
+ import { Text } from './Text';
7
+
8
+ class OptionsSection extends Component {
9
+ getSelectedOption() {
10
+ return _.find(this.props.options, (o) => this.props.selected === o.key);
11
+ }
12
+
13
+ getTitle() {
14
+ const selectedOption = this.getSelectedOption();
15
+ if (!selectedOption) {
16
+ return '';
17
+ }
18
+ return selectedOption.text;
19
+ }
20
+
21
+ renderIcon(o, isSelected) {
22
+ switch (o.iconType) {
23
+ case 'fa':
24
+ return <FontAwesomeIcon className="optionsButton_icon" icon={o.icon} />;
25
+ default:
26
+ return <SVGIcon icon={o.icon} colour={isSelected ? '#fff' : COLOUR_BRANDING_MAIN} />;
27
+ }
28
+ }
29
+
30
+ renderOptionButton(o) {
31
+ const isSelected = this.props.selected === o.key;
32
+ return (
33
+ <div
34
+ className={`optionsButton${isSelected ? ' optionsButton-selected' : ''}`}
35
+ key={o.key}
36
+ onClick={() => {
37
+ this.props.selectOption(o.key);
38
+ }}
39
+ >
40
+ <div className="optionsButton_iconContainer">{this.renderIcon(o, isSelected)}</div>
41
+ <Text type="formLabelSmall" className="optionsButton_text">
42
+ {o.text}
43
+ </Text>
44
+ </div>
45
+ );
46
+ }
47
+
48
+ renderContent() {
49
+ const selectedOption = this.getSelectedOption();
50
+ if (selectedOption && selectedOption.content) {
51
+ return selectedOption.content;
52
+ }
53
+ return this.props.children;
54
+ }
55
+
56
+ render() {
57
+ return (
58
+ <div className={`optionsSection${this.props.overflowButtons ? ' optionsSection-overflowButtons' : ''}`}>
59
+ <div className="optionsSection_banner">
60
+ <div className="optionsSection_banner_top">
61
+ <Text type="formTitleMedium" className="optionsSection_banner_top_title">
62
+ More Options
63
+ </Text>
64
+ </div>
65
+ <div className="optionsSection_banner_buttonSection">
66
+ {this.props.options.map((o) => {
67
+ return this.renderOptionButton(o);
68
+ })}
69
+ </div>
70
+ </div>
71
+ <div className="optionsContent">
72
+ <div className="optionsContent_box">
73
+ <div className="optionsContent_box_top">
74
+ <Text type="formTitleSmall">{this.getTitle()}</Text>
75
+ </div>
76
+ {this.renderContent()}
77
+ </div>
78
+ </div>
79
+ </div>
80
+ );
81
+ }
82
+ }
83
+
84
+ export { OptionsSection };
@@ -0,0 +1,74 @@
1
+ import React, { Component } from 'react';
2
+
3
+ class OverlayPage extends Component {
4
+ constructor(props) {
5
+ super(props);
6
+ this.state = {
7
+ width: 0,
8
+ height: 0,
9
+ };
10
+ this.updateWindowDimensions = this.updateWindowDimensions.bind(this);
11
+ }
12
+
13
+ componentDidMount() {
14
+ this.updateWindowDimensions();
15
+ window.addEventListener('resize', this.updateWindowDimensions);
16
+ // setTimeout(() => {
17
+ // this.setState({ opacity: 1 });
18
+ // }, 100);
19
+ }
20
+
21
+ componentWillUnmount() {
22
+ window.removeEventListener('resize', this.updateWindowDimensions);
23
+ }
24
+
25
+ updateWindowDimensions() {
26
+ this.setState({ width: window.innerWidth, height: window.innerHeight });
27
+ }
28
+
29
+ renderContent() {
30
+ if (this.props.fullPage) {
31
+ return (
32
+ <div className="overlayPage-full" style={this.props.fullPageStyle}>
33
+ {this.props.children}
34
+ </div>
35
+ );
36
+ }
37
+ return this.props.children;
38
+ }
39
+
40
+ render() {
41
+ return (
42
+ <div style={{ ...styles.pageWrapper, ...this.props.style }}>
43
+ <div
44
+ style={{
45
+ ...styles.backgroundOverlay,
46
+ ...this.props.backgroundStyle,
47
+ }}
48
+ />
49
+ {this.renderContent()}
50
+ </div>
51
+ );
52
+ }
53
+ }
54
+
55
+ const styles = {
56
+ pageWrapper: {
57
+ position: 'fixed',
58
+ zIndex: 100,
59
+ top: 0,
60
+ left: 0,
61
+ height: '100vh',
62
+ },
63
+ backgroundOverlay: {
64
+ position: 'fixed',
65
+ width: '100vw',
66
+ height: '100vh',
67
+ backgroundColor: '#3f4264',
68
+ top: 0,
69
+ left: 0,
70
+ zIndex: -1,
71
+ },
72
+ };
73
+
74
+ export { OverlayPage };
@@ -0,0 +1,48 @@
1
+ import React, { Component } from 'react';
2
+ import { LINEGREY } from '../colours';
3
+
4
+ class OverlayPageBottomButtons extends Component {
5
+ constructor(props) {
6
+ super(props);
7
+ this.state = {
8
+ opacity: 0,
9
+ };
10
+ }
11
+
12
+ componentDidMount() {
13
+ setTimeout(() => {
14
+ this.setState({ opacity: 1 });
15
+ }, 100);
16
+ }
17
+
18
+ render() {
19
+ return (
20
+ <div
21
+ className="animateOpacity"
22
+ style={{
23
+ ...styles.wrapper,
24
+ opacity: this.state.opacity,
25
+ ...this.props.style,
26
+ }}
27
+ >
28
+ {this.props.children}
29
+ </div>
30
+ );
31
+ }
32
+ }
33
+
34
+ const styles = {
35
+ wrapper: {
36
+ padding: 12,
37
+ paddingRight: 24,
38
+ width: '100%',
39
+ maxWidth: '100vw',
40
+ backgroundColor: '#fff',
41
+ borderTop: '1px solid',
42
+ borderTopColor: LINEGREY,
43
+ display: 'flex',
44
+ justifyContent: 'flex-end',
45
+ },
46
+ };
47
+
48
+ export { OverlayPageBottomButtons };
@@ -0,0 +1,48 @@
1
+ import React, { Component } from 'react';
2
+
3
+ class OverlayPageContents extends Component {
4
+ constructor(props) {
5
+ super(props);
6
+ this.state = {
7
+ opacity: 0,
8
+ };
9
+ }
10
+
11
+ componentDidMount() {
12
+ setTimeout(() => {
13
+ this.setState({ opacity: 1 });
14
+ }, 100);
15
+ }
16
+
17
+ render() {
18
+ return (
19
+ <div
20
+ id={this.props.id}
21
+ className="animateOpacity"
22
+ style={{
23
+ ...styles.wrapper,
24
+ height: this.props.noBottomButtons ? '100%' : 'calc(100% - 57px)',
25
+ opacity: this.state.opacity,
26
+ ...this.props.style,
27
+ }}
28
+ >
29
+ {this.props.children}
30
+ </div>
31
+ );
32
+ }
33
+ }
34
+
35
+ const styles = {
36
+ wrapper: {
37
+ clear: 'both',
38
+ whiteSpace: 'nowrap',
39
+ overflow: 'hidden',
40
+ overflowX: 'auto',
41
+ fontSize: 0,
42
+ width: 'fit-content',
43
+ maxWidth: '100vw',
44
+ opacity: 0,
45
+ },
46
+ };
47
+
48
+ export { OverlayPageContents };
@@ -0,0 +1,38 @@
1
+ import React, { Component } from 'react';
2
+
3
+ class OverlayPageSection extends Component {
4
+ getClassName() {
5
+ if (this.props.className) {
6
+ return 'pageSectionWrapper ' + this.props.className;
7
+ }
8
+ return 'pageSectionWrapper';
9
+ }
10
+
11
+ render() {
12
+ return (
13
+ <div
14
+ {...this.props}
15
+ className={this.getClassName()}
16
+ style={{
17
+ ...styles.wrapper,
18
+ ...this.props.style,
19
+ }}
20
+ >
21
+ {this.props.children}
22
+ </div>
23
+ );
24
+ }
25
+ }
26
+
27
+ const styles = {
28
+ wrapper: {
29
+ /* height: '100%',
30
+ overflowY: 'auto',
31
+ backgroundColor: '#fff',
32
+ padding: 24,
33
+ display: 'inline-block',
34
+ verticalAlign: 'top' */
35
+ },
36
+ };
37
+
38
+ export { OverlayPageSection };
@@ -0,0 +1,40 @@
1
+ import React, { Component } from 'react';
2
+ import _ from 'lodash';
3
+
4
+ class P60Icon extends Component {
5
+ state = {
6
+ doublePaths: ['add-image', 'add-circle', 'facility', 'news'],
7
+ triplePaths: [],
8
+ };
9
+
10
+ renderIconPaths() {
11
+ if (_.includes(this.state.doublePaths, this.props.icon)) {
12
+ return (
13
+ <span>
14
+ <span className="path1" />
15
+ <span className={`path2${this.props.icon !== 'add-image' ? ' text-white' : ''}`} />
16
+ </span>
17
+ );
18
+ }
19
+ if (_.includes(this.state.triplePaths, this.props.icon)) {
20
+ return (
21
+ <span>
22
+ <span className="path1" />
23
+ <span className="path2" />
24
+ <span className="path3" />
25
+ </span>
26
+ );
27
+ }
28
+ return null;
29
+ }
30
+
31
+ render() {
32
+ return (
33
+ <div {...this.props} className={`${this.props.className} p60icon-${this.props.icon}`}>
34
+ {this.renderIconPaths()}
35
+ </div>
36
+ );
37
+ }
38
+ }
39
+
40
+ export { P60Icon };
@@ -0,0 +1,13 @@
1
+ import React, { Component } from 'react';
2
+
3
+ class PageTitle extends Component {
4
+ render() {
5
+ return (
6
+ <p className="managingPageTitle" {...this.props}>
7
+ {this.props.children}
8
+ </p>
9
+ );
10
+ }
11
+ }
12
+
13
+ export { PageTitle };