@eeacms/volto-eea-website-theme 1.6.0 → 1.6.2
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.
package/CHANGELOG.md
CHANGED
@@ -4,11 +4,27 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
4
4
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
6
6
|
|
7
|
-
### [1.6.
|
7
|
+
### [1.6.2](https://github.com/eea/volto-eea-website-theme/compare/1.6.1...1.6.2) - 27 January 2023
|
8
|
+
|
9
|
+
#### :bug: Bug Fixes
|
10
|
+
|
11
|
+
- fix(banner): properly pass image source to banner [David Ichim - [`465e616`](https://github.com/eea/volto-eea-website-theme/commit/465e61651eeb3abd05ac1b8fda2d754b59d28faa)]
|
12
|
+
- fix(cypress): use force click [nileshgulia1 - [`3c8db52`](https://github.com/eea/volto-eea-website-theme/commit/3c8db5271fea819fdeebda9773d376abf498759a)]
|
13
|
+
- fix(eslint): remove warning [nileshgulia1 - [`d01a1da`](https://github.com/eea/volto-eea-website-theme/commit/d01a1da6b5fb10c8774fdfb962310be95f9a5690)]
|
14
|
+
|
15
|
+
#### :nail_care: Enhancements
|
16
|
+
|
17
|
+
- refactor(banner): sync storybook and Volto component #76 from eea/sync-page-banner-theme [ichim-david - [`fad29fb`](https://github.com/eea/volto-eea-website-theme/commit/fad29fb4581c640a27e14743803eadb63ff67334)]
|
18
|
+
- change(banner): removed container wrapper since it was moved inside banner component [David Ichim - [`5cf9c3b`](https://github.com/eea/volto-eea-website-theme/commit/5cf9c3bc9f443ee45f234744a1a4c589420e3815)]
|
19
|
+
- refactor(banner): sync storybook and Volto component [nileshgulia1 - [`d2d6a61`](https://github.com/eea/volto-eea-website-theme/commit/d2d6a617f5d270768448bc3f0637c5aea60d70f2)]
|
8
20
|
|
9
21
|
#### :hammer_and_wrench: Others
|
10
22
|
|
11
|
-
-
|
23
|
+
- remove(banner): shift banner title css to design system [nileshgulia1 - [`aff9f74`](https://github.com/eea/volto-eea-website-theme/commit/aff9f74f5e9ce858b4eeaf6b02cee9b5c61813a9)]
|
24
|
+
### [1.6.1](https://github.com/eea/volto-eea-website-theme/compare/1.6.0...1.6.1) - 25 January 2023
|
25
|
+
|
26
|
+
### [1.6.0](https://github.com/eea/volto-eea-website-theme/compare/1.5.1...1.6.0) - 17 January 2023
|
27
|
+
|
12
28
|
### [1.5.1](https://github.com/eea/volto-eea-website-theme/compare/1.5.0...1.5.1) - 13 January 2023
|
13
29
|
|
14
30
|
#### :bug: Bug Fixes
|
@@ -20,6 +36,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
20
36
|
|
21
37
|
- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
|
22
38
|
- Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
|
39
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
|
23
40
|
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
|
24
41
|
|
25
42
|
#### :hammer_and_wrench: Others
|
@@ -53,6 +70,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
53
70
|
|
54
71
|
- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
|
55
72
|
- bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
|
73
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
|
56
74
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
|
57
75
|
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
|
58
76
|
|
@@ -62,6 +80,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
62
80
|
|
63
81
|
#### :hammer_and_wrench: Others
|
64
82
|
|
83
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
|
65
84
|
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
|
66
85
|
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
|
67
86
|
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
|
@@ -70,6 +89,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
70
89
|
|
71
90
|
- feat(Footer): Bring back footer contacts extra actions - refs #151856 [Alin Voinea - [`6c19413`](https://github.com/eea/volto-eea-website-theme/commit/6c194139420c9fd847692d180db1c1593e2483de)]
|
72
91
|
|
92
|
+
#### :hammer_and_wrench: Others
|
93
|
+
|
94
|
+
- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
|
73
95
|
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
|
74
96
|
|
75
97
|
#### :rocket: New Features
|
@@ -110,6 +132,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
110
132
|
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
|
111
133
|
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
|
112
134
|
- fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
|
135
|
+
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
|
113
136
|
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
|
114
137
|
|
115
138
|
#### :nail_care: Enhancements
|
@@ -157,6 +180,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
157
180
|
|
158
181
|
#### :hammer_and_wrench: Others
|
159
182
|
|
183
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
|
160
184
|
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
|
161
185
|
|
162
186
|
#### :hammer_and_wrench: Others
|
@@ -424,6 +448,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
424
448
|
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
|
425
449
|
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
|
426
450
|
- feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
|
451
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
|
427
452
|
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
|
428
453
|
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
|
429
454
|
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
|
@@ -465,4 +490,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
465
490
|
|
466
491
|
#### :hammer_and_wrench: Others
|
467
492
|
|
493
|
+
- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
|
468
494
|
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eeacms/volto-eea-website-theme",
|
3
|
-
"version": "1.6.
|
3
|
+
"version": "1.6.2",
|
4
4
|
"description": "@eeacms/volto-eea-website-theme: Volto add-on",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"url": "git@github.com:eea/volto-eea-website-theme.git"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@eeacms/volto-eea-design-system": "^1.0.0-alpha.
|
25
|
+
"@eeacms/volto-eea-design-system": "^1.0.0-alpha.12",
|
26
26
|
"volto-subsites": "*"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
@@ -5,10 +5,13 @@ import { withRouter } from 'react-router';
|
|
5
5
|
import { defineMessages, injectIntl } from 'react-intl';
|
6
6
|
import { startCase } from 'lodash';
|
7
7
|
import qs from 'querystring';
|
8
|
-
import {
|
8
|
+
import { Popup, Icon } from 'semantic-ui-react';
|
9
9
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
10
|
-
import Banner from '
|
11
|
-
import {
|
10
|
+
import Banner from '@eeacms/volto-eea-design-system/ui/Banner/Banner';
|
11
|
+
import {
|
12
|
+
getImageSource,
|
13
|
+
sharePage,
|
14
|
+
} from '@eeacms/volto-eea-design-system/ui/Banner/Banner';
|
12
15
|
import Copyright from '@eeacms/volto-eea-design-system/ui/Copyright/Copyright';
|
13
16
|
|
14
17
|
import './styles.less';
|
@@ -57,11 +60,6 @@ const friendlyId = (id) => {
|
|
57
60
|
return startCase(id);
|
58
61
|
};
|
59
62
|
|
60
|
-
const ContainerWrapper = ({ fluid, children }) => {
|
61
|
-
if (fluid) return <React.Fragment>{children}</React.Fragment>;
|
62
|
-
return <Container>{children}</Container>;
|
63
|
-
};
|
64
|
-
|
65
63
|
const Title = ({ config = {}, properties }) => {
|
66
64
|
const view = useMemo(() => {
|
67
65
|
return config.view;
|
@@ -74,7 +72,7 @@ const Title = ({ config = {}, properties }) => {
|
|
74
72
|
};
|
75
73
|
|
76
74
|
const View = (props) => {
|
77
|
-
const { banner = {},
|
75
|
+
const { banner = {}, intl, location, types = [] } = props;
|
78
76
|
const metadata = props.metadata || props.properties;
|
79
77
|
const {
|
80
78
|
info = [],
|
@@ -113,6 +111,7 @@ const View = (props) => {
|
|
113
111
|
() => getDate(hideModificationDate, 'modified'),
|
114
112
|
[getDate, hideModificationDate],
|
115
113
|
);
|
114
|
+
|
116
115
|
// Set image source
|
117
116
|
const image = getImageSource(metadata['image']);
|
118
117
|
// Get type
|
@@ -130,116 +129,106 @@ const View = (props) => {
|
|
130
129
|
}, [types, metadata, parameters]);
|
131
130
|
|
132
131
|
return (
|
133
|
-
<Banner {...props}>
|
134
|
-
<
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
trigger={
|
174
|
-
<Banner.Action
|
175
|
-
icon="ri-share-fill"
|
176
|
-
title={intl.formatMessage(messages.share)}
|
177
|
-
className="share"
|
178
|
-
onClick={() => {}}
|
179
|
-
/>
|
180
|
-
}
|
181
|
-
/>
|
182
|
-
)}
|
183
|
-
{!hideDownloadButton && (
|
184
|
-
<Banner.Action
|
185
|
-
icon="ri-download-2-fill"
|
186
|
-
title={intl.formatMessage(messages.download)}
|
187
|
-
className="download"
|
188
|
-
onClick={() => {
|
189
|
-
window.print();
|
190
|
-
}}
|
191
|
-
/>
|
192
|
-
)}
|
193
|
-
</>
|
194
|
-
}
|
195
|
-
>
|
196
|
-
<Title config={banner.title} properties={metadata} />
|
197
|
-
<Banner.Metadata>
|
198
|
-
<Banner.MetadataField
|
199
|
-
type="type"
|
200
|
-
hidden={hideContentType}
|
201
|
-
// value={contentType || properties['@type'] || parameters.type}
|
202
|
-
value={type}
|
203
|
-
/>
|
204
|
-
<Banner.MetadataField
|
205
|
-
type="date"
|
206
|
-
label={intl.formatMessage(messages.created)}
|
207
|
-
value={creationDate}
|
208
|
-
title={`${intl.formatMessage(messages.created_on)} {}`}
|
209
|
-
/>
|
210
|
-
<Banner.MetadataField
|
211
|
-
type="date"
|
212
|
-
label={intl.formatMessage(messages.published)}
|
213
|
-
value={publishingDate}
|
214
|
-
title={`${intl.formatMessage(messages.published_on)} {}`}
|
215
|
-
/>
|
216
|
-
<Banner.MetadataField
|
217
|
-
type="date"
|
218
|
-
label={intl.formatMessage(messages.modified)}
|
219
|
-
value={modificationDate}
|
220
|
-
title={`${intl.formatMessage(messages.modified_on)} {}`}
|
221
|
-
/>
|
222
|
-
{info.map((item, index) => (
|
223
|
-
<Banner.MetadataField
|
224
|
-
key={`header-info-${index}`}
|
225
|
-
value={item.description}
|
132
|
+
<Banner {...props} image={image}>
|
133
|
+
<Banner.Content
|
134
|
+
actions={
|
135
|
+
<>
|
136
|
+
{!hideShareButton && (
|
137
|
+
<Popup
|
138
|
+
className="share-popup"
|
139
|
+
content={() => (
|
140
|
+
<>
|
141
|
+
<p>{intl.formatMessage(messages.share_to)}</p>
|
142
|
+
<div className="actions">
|
143
|
+
<Banner.Action
|
144
|
+
icon="ri-facebook-fill"
|
145
|
+
onClick={() => {
|
146
|
+
sharePage(metadata['@id'], 'facebook');
|
147
|
+
}}
|
148
|
+
/>
|
149
|
+
<Banner.Action
|
150
|
+
icon="ri-twitter-fill"
|
151
|
+
onClick={() => {
|
152
|
+
sharePage(metadata['@id'], 'twitter');
|
153
|
+
}}
|
154
|
+
/>
|
155
|
+
<Banner.Action
|
156
|
+
icon="ri-linkedin-fill"
|
157
|
+
onClick={() => {
|
158
|
+
sharePage(metadata['@id'], 'linkedin');
|
159
|
+
}}
|
160
|
+
/>
|
161
|
+
</div>
|
162
|
+
</>
|
163
|
+
)}
|
164
|
+
position="bottom center"
|
165
|
+
size="small"
|
166
|
+
trigger={
|
167
|
+
<Banner.Action
|
168
|
+
icon="ri-share-fill"
|
169
|
+
title={intl.formatMessage(messages.share)}
|
170
|
+
className="share"
|
171
|
+
onClick={() => {}}
|
226
172
|
/>
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
173
|
+
}
|
174
|
+
/>
|
175
|
+
)}
|
176
|
+
{!hideDownloadButton && (
|
177
|
+
<Banner.Action
|
178
|
+
icon="ri-download-2-fill"
|
179
|
+
title={intl.formatMessage(messages.download)}
|
180
|
+
className="download"
|
181
|
+
onClick={() => {
|
182
|
+
window.print();
|
183
|
+
}}
|
184
|
+
/>
|
185
|
+
)}
|
186
|
+
</>
|
187
|
+
}
|
188
|
+
>
|
189
|
+
<Title config={banner.title} properties={metadata} />
|
190
|
+
<Banner.Metadata>
|
191
|
+
<Banner.MetadataField
|
192
|
+
type="type"
|
193
|
+
hidden={hideContentType}
|
194
|
+
value={type}
|
195
|
+
/>
|
196
|
+
<Banner.MetadataField
|
197
|
+
type="date"
|
198
|
+
label={intl.formatMessage(messages.created)}
|
199
|
+
value={creationDate}
|
200
|
+
title={`${intl.formatMessage(messages.created_on)} {}`}
|
201
|
+
/>
|
202
|
+
<Banner.MetadataField
|
203
|
+
type="date"
|
204
|
+
label={intl.formatMessage(messages.published)}
|
205
|
+
value={publishingDate}
|
206
|
+
title={`${intl.formatMessage(messages.published_on)} {}`}
|
207
|
+
/>
|
208
|
+
<Banner.MetadataField
|
209
|
+
type="date"
|
210
|
+
label={intl.formatMessage(messages.modified)}
|
211
|
+
value={modificationDate}
|
212
|
+
title={`${intl.formatMessage(messages.modified_on)} {}`}
|
213
|
+
/>
|
214
|
+
{info.map((item, index) => (
|
215
|
+
<Banner.MetadataField
|
216
|
+
key={`header-info-${index}`}
|
217
|
+
value={item.description}
|
218
|
+
/>
|
219
|
+
))}
|
220
|
+
</Banner.Metadata>
|
221
|
+
{copyright ? (
|
222
|
+
<Copyright copyrightPosition={copyrightPosition}>
|
223
|
+
<Copyright.Icon>
|
224
|
+
<Icon className={copyrightIcon} />
|
225
|
+
</Copyright.Icon>
|
226
|
+
<Copyright.Text>{copyright}</Copyright.Text>
|
227
|
+
</Copyright>
|
228
|
+
) : (
|
229
|
+
''
|
230
|
+
)}
|
231
|
+
</Banner.Content>
|
243
232
|
</Banner>
|
244
233
|
);
|
245
234
|
};
|
package/src/index.js
CHANGED
@@ -139,6 +139,15 @@ const applyConfig = (config) => {
|
|
139
139
|
// Custom block-style colors
|
140
140
|
config.settings.available_colors = eea.colors;
|
141
141
|
|
142
|
+
// Site theme colors
|
143
|
+
|
144
|
+
config.settings.themeColors = [
|
145
|
+
{ value: 'default', title: 'Default' },
|
146
|
+
{ value: 'primary', title: 'Primary' },
|
147
|
+
{ value: 'secondary', title: 'Secondary' },
|
148
|
+
{ value: 'tertiary', title: 'Tertiary' },
|
149
|
+
];
|
150
|
+
|
142
151
|
// Custom block styles
|
143
152
|
config.settings.previewText = '';
|
144
153
|
config.settings.pluggableStyles = [
|
@@ -1,99 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { compose } from 'redux';
|
3
|
-
import { connect } from 'react-redux';
|
4
|
-
import { Icon, Button, Grid } from 'semantic-ui-react';
|
5
|
-
import { formatDate } from '@plone/volto/helpers/Utils/Date';
|
6
|
-
import config from '@plone/volto/registry';
|
7
|
-
|
8
|
-
const socialPlatforms = {
|
9
|
-
facebook: {
|
10
|
-
shareLink: (url) => `https://facebook.com/sharer.php?u=${url}`,
|
11
|
-
},
|
12
|
-
twitter: {
|
13
|
-
shareLink: (url) => `https://www.twitter.com/share?url=${url}`,
|
14
|
-
},
|
15
|
-
linkedin: {
|
16
|
-
shareLink: (url) =>
|
17
|
-
`https://www.linkedin.com/sharing/share-offsite/?url=${url}`,
|
18
|
-
},
|
19
|
-
reddit: {
|
20
|
-
shareLink: (url, title) => `https://reddit.com/submit?url=${url}`,
|
21
|
-
},
|
22
|
-
};
|
23
|
-
|
24
|
-
export const getImageSource = (image) => {
|
25
|
-
if (image?.download) return image.download;
|
26
|
-
if (image?.encoding)
|
27
|
-
return `data:${image['content-type']};${image['encoding']},${image['data']}`;
|
28
|
-
return null;
|
29
|
-
};
|
30
|
-
|
31
|
-
export const sharePage = (url, platform) => {
|
32
|
-
if (!socialPlatforms[platform]) return;
|
33
|
-
const link = document.createElement('a');
|
34
|
-
link.setAttribute('href', socialPlatforms[platform].shareLink(url));
|
35
|
-
link.setAttribute('target', '_blank');
|
36
|
-
link.setAttribute('rel', 'noreferrer');
|
37
|
-
link.click();
|
38
|
-
};
|
39
|
-
|
40
|
-
const Banner = ({ children }) => {
|
41
|
-
return <div className="eea banner">{children}</div>;
|
42
|
-
};
|
43
|
-
|
44
|
-
Banner.Action = ({ title, icon, color, onClick, className }) => {
|
45
|
-
return (
|
46
|
-
<div className="action">
|
47
|
-
<Button className={className} basic icon inverted onClick={onClick}>
|
48
|
-
<Icon className={icon} color={color}></Icon>
|
49
|
-
<span className="mobile hidden">{title}</span>
|
50
|
-
</Button>
|
51
|
-
</div>
|
52
|
-
);
|
53
|
-
};
|
54
|
-
|
55
|
-
Banner.Content = ({ children, actions }) => {
|
56
|
-
return (
|
57
|
-
<div className="content">
|
58
|
-
<Grid>
|
59
|
-
<Grid.Column mobile={10} tablet={9} computer={9}>
|
60
|
-
{children}
|
61
|
-
</Grid.Column>
|
62
|
-
<Grid.Column mobile={2} tablet={3} computer={3} className="actions">
|
63
|
-
{actions}
|
64
|
-
</Grid.Column>
|
65
|
-
</Grid>
|
66
|
-
</div>
|
67
|
-
);
|
68
|
-
};
|
69
|
-
|
70
|
-
Banner.Title = ({ children }) => (
|
71
|
-
<h1 className="documentFirstHeading">{children}</h1>
|
72
|
-
);
|
73
|
-
Banner.Metadata = ({ children }) => <p className="metadata">{children}</p>;
|
74
|
-
Banner.MetadataField = ({ hidden, type = 'text', label, value, title }) => {
|
75
|
-
const locale = config.settings.dateLocale || 'en-gb';
|
76
|
-
if (hidden || !value) return '';
|
77
|
-
if (type === 'date' && value)
|
78
|
-
return (
|
79
|
-
<span className={`field ${type}`} title={title.replace('{}', value)}>
|
80
|
-
{label}{' '}
|
81
|
-
{formatDate({
|
82
|
-
date: value,
|
83
|
-
format: {
|
84
|
-
year: 'numeric',
|
85
|
-
month: 'short',
|
86
|
-
day: '2-digit',
|
87
|
-
},
|
88
|
-
locale: locale,
|
89
|
-
})}
|
90
|
-
</span>
|
91
|
-
);
|
92
|
-
return <span className={`field ${type}`}>{value}</span>;
|
93
|
-
};
|
94
|
-
|
95
|
-
export default compose(
|
96
|
-
connect((state) => ({
|
97
|
-
content: state.content.data,
|
98
|
-
})),
|
99
|
-
)(Banner);
|