@kitconcept/volto-light-theme 6.0.0-alpha.8 → 6.0.0
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.draft +1 -5
- package/CHANGELOG.md +226 -0
- package/README.md +6 -5
- package/locales/de/LC_MESSAGES/volto.po +171 -38
- package/locales/en/LC_MESSAGES/volto.po +170 -37
- package/locales/es/LC_MESSAGES/volto.po +171 -38
- package/locales/eu/LC_MESSAGES/volto.po +171 -38
- package/locales/pt_BR/volto.po +171 -38
- package/locales/volto.pot +171 -38
- package/package.json +15 -6
- package/src/components/Blocks/EventMetadata/View.jsx +32 -26
- package/src/components/Blocks/Listing/DefaultTemplate.jsx +19 -14
- package/src/components/Blocks/Listing/GridTemplate.jsx +9 -12
- package/src/components/Blocks/Listing/SummaryTemplate.jsx +9 -7
- package/src/components/Blocks/Teaser/DefaultBody.jsx +93 -0
- package/src/components/Blocks/Teaser/schema.js +1 -7
- package/src/components/Footer/ColumnLinks.tsx +35 -0
- package/src/components/Footer/Footer.tsx +32 -0
- package/src/components/Footer/slots/Colophon.tsx +24 -0
- package/src/components/Footer/slots/Copyright.tsx +65 -0
- package/src/components/Footer/slots/CoreFooter.tsx +82 -0
- package/src/components/Footer/slots/FollowUsLogoAndLinks.tsx +80 -0
- package/src/components/Footer/slots/FooterLogos.tsx +44 -0
- package/src/components/Header/Header.tsx +257 -0
- package/src/components/Logo/Logo.tsx +85 -0
- package/src/components/{Footer/FooterLogos.tsx → LogosContainer/LogosContainer.tsx} +24 -25
- package/src/components/MobileNavigation/MobileNavigation.jsx +53 -18
- package/src/components/Navigation/Navigation.jsx +14 -3
- package/src/components/SearchWidget/IntranetSearchWidget.jsx +32 -5
- package/src/components/SearchWidget/SearchWidget.jsx +1 -1
- package/src/components/StickyMenu/StickyMenu.tsx +36 -0
- package/src/components/Summary/DefaultSummary.jsx +16 -0
- package/src/components/Summary/EventSummary.jsx +38 -0
- package/src/components/Summary/FileSummary.jsx +24 -0
- package/src/components/Summary/NewsItemSummary.jsx +40 -0
- package/src/components/Tags/Tags.jsx +46 -0
- package/src/components/Theme/EventView.jsx +19 -25
- package/src/components/Theme/NewsItemView.jsx +13 -9
- package/src/components/Theming/Theming.tsx +20 -17
- package/src/components/Widgets/{BlockAlignmentWidget.tsx → BlockAlignment.tsx} +9 -2
- package/src/components/Widgets/{BlockWidthWidget.tsx → BlockWidth.tsx} +10 -3
- package/src/components/Widgets/BlocksObject.tsx +353 -0
- package/src/components/Widgets/Buttons.tsx +117 -0
- package/src/components/Widgets/ColorContrastChecker.tsx +117 -0
- package/src/components/Widgets/ColorPicker.tsx +59 -0
- package/src/components/Widgets/{ColorPickerWidget.tsx → ColorSwatch.tsx} +5 -5
- package/src/components/Widgets/ObjectList.tsx +342 -0
- package/src/components/Widgets/{ThemingColorPicker.tsx → RACThemingColorPicker.tsx} +4 -0
- package/src/components/Widgets/Size.tsx +75 -0
- package/src/components/Widgets/ThemeColorSwatch.tsx +17 -0
- package/src/components/Widgets/schema/footerLinksSchema.ts +64 -0
- package/src/components/Widgets/schema/footerLogosSchema.ts +98 -0
- package/src/components/Widgets/schema/headerActionsSchema.ts +64 -0
- package/src/components/Widgets/schema/iconLinkListSchema.ts +98 -0
- package/src/config/blocks.tsx +39 -20
- package/src/config/settings.ts +54 -12
- package/src/config/slots.ts +36 -1
- package/src/config/summary.ts +24 -0
- package/src/config/widgets.ts +57 -20
- package/src/customizations/volto/components/manage/Blocks/Teaser/DefaultBody.jsx +8 -0
- package/src/customizations/volto/components/theme/Tags/Tags.jsx +11 -0
- package/src/customizations/volto/components/theme/View/RenderBlocks.jsx +2 -1
- package/src/helpers/DndSortableList.tsx +138 -0
- package/src/helpers/dates.js +22 -0
- package/src/helpers/doesNodeContainClick.js +64 -0
- package/src/helpers/useLiveData.ts +29 -0
- package/src/index.ts +33 -2
- package/src/primitives/IconLinkList.tsx +69 -0
- package/src/primitives/LinkList.tsx +35 -0
- package/src/theme/_bgcolor-blocks-layout.scss +50 -12
- package/src/theme/_container.scss +4 -0
- package/src/theme/_content.scss +6 -0
- package/src/theme/_footer.scss +295 -43
- package/src/theme/_header.scss +132 -19
- package/src/theme/_layout.scss +11 -1
- package/src/theme/_sitemap.scss +4 -0
- package/src/theme/_utils.scss +14 -1
- package/src/theme/_variables.scss +12 -3
- package/src/theme/_widgets.scss +102 -10
- package/src/theme/blocks/_eventMetadata.scss +5 -2
- package/src/theme/blocks/_grid.scss +3 -3
- package/src/theme/blocks/_highlight.scss +17 -44
- package/src/theme/blocks/_listing.scss +25 -16
- package/src/theme/blocks/_maps.scss +3 -3
- package/src/theme/blocks/_slider.scss +5 -1
- package/src/theme/main.scss +1 -0
- package/src/theme/sticky-menu.scss +50 -0
- package/src/types.d.ts +102 -0
- package/tsconfig.json +1 -1
- package/src/components/Footer/Footer.jsx +0 -115
- package/src/components/Footer/FooterLinks.tsx +0 -57
- package/src/components/Header/Header.jsx +0 -161
- package/src/components/Logo/Logo.jsx +0 -51
- package/src/components/Widgets/AlignWidget.jsx +0 -80
- package/src/components/Widgets/BackgroundColorWidget.tsx +0 -17
- package/src/components/Widgets/BlocksObjectWidget.tsx +0 -333
- package/src/components/Widgets/ButtonsWidget.tsx +0 -68
- package/src/components/Widgets/FooterLinksWidget.tsx +0 -106
- package/src/components/Widgets/FooterLogosWidget.tsx +0 -120
- package/src/static/container-query-polyfill.modern.js +0 -1
- package/src/types/index.d.ts +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Message } from 'semantic-ui-react';
|
|
4
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
5
|
+
import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg';
|
|
6
|
+
import { isInternalURL } from '@plone/volto/helpers/Url/Url';
|
|
7
|
+
import MaybeWrap from '@plone/volto/components/manage/MaybeWrap/MaybeWrap';
|
|
8
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
9
|
+
import cx from 'classnames';
|
|
10
|
+
import config from '@plone/volto/registry';
|
|
11
|
+
import DefaultSummary from '@kitconcept/volto-light-theme/components/Summary/DefaultSummary';
|
|
12
|
+
|
|
13
|
+
const messages = defineMessages({
|
|
14
|
+
PleaseChooseContent: {
|
|
15
|
+
id: 'Please choose an existing content as source for this element',
|
|
16
|
+
defaultMessage:
|
|
17
|
+
'Please choose an existing content as source for this element',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const TeaserDefaultTemplate = (props) => {
|
|
22
|
+
const { className, data, isEditMode, style } = props;
|
|
23
|
+
const intl = useIntl();
|
|
24
|
+
const href = data.href?.[0] || {};
|
|
25
|
+
const image = data.preview_image?.[0];
|
|
26
|
+
const url = data.preview_image?.[0]?.['@id'];
|
|
27
|
+
|
|
28
|
+
const Image = config.getComponent('Image').component;
|
|
29
|
+
const Summary =
|
|
30
|
+
config.getComponent({
|
|
31
|
+
name: 'Summary',
|
|
32
|
+
dependencies: [href['@type']],
|
|
33
|
+
}).component || DefaultSummary;
|
|
34
|
+
const { openExternalLinkInNewTab } = config.settings;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div className={cx('block teaser', className)} style={style}>
|
|
38
|
+
<>
|
|
39
|
+
{!href && isEditMode && (
|
|
40
|
+
<Message>
|
|
41
|
+
<div className="teaser-item placeholder">
|
|
42
|
+
<img src={imageBlockSVG} alt="" />
|
|
43
|
+
<p>{intl.formatMessage(messages.PleaseChooseContent)}</p>
|
|
44
|
+
</div>
|
|
45
|
+
</Message>
|
|
46
|
+
)}
|
|
47
|
+
{href && (
|
|
48
|
+
<MaybeWrap
|
|
49
|
+
condition={!isEditMode}
|
|
50
|
+
as={UniversalLink}
|
|
51
|
+
href={href['@id']}
|
|
52
|
+
target={
|
|
53
|
+
data.openLinkInNewTab ||
|
|
54
|
+
(openExternalLinkInNewTab && !isInternalURL(href['@id']))
|
|
55
|
+
? '_blank'
|
|
56
|
+
: null
|
|
57
|
+
}
|
|
58
|
+
>
|
|
59
|
+
<div className="teaser-item default">
|
|
60
|
+
{url && !image?.image_field ? (
|
|
61
|
+
<div className="image-wrapper">
|
|
62
|
+
<Image src={url} alt="" loading="lazy" responsive={true} />
|
|
63
|
+
</div>
|
|
64
|
+
) : (
|
|
65
|
+
(href.hasPreviewImage || href.image_field || image) && (
|
|
66
|
+
<div className="image-wrapper">
|
|
67
|
+
<Image
|
|
68
|
+
item={image || href}
|
|
69
|
+
imageField={image ? image.image_field : href.image_field}
|
|
70
|
+
alt=""
|
|
71
|
+
loading="lazy"
|
|
72
|
+
responsive={true}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
)
|
|
76
|
+
)}
|
|
77
|
+
<div className="content">
|
|
78
|
+
<Summary item={{ ...href, ...data }} HeadingTag="h2" />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</MaybeWrap>
|
|
82
|
+
)}
|
|
83
|
+
</>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
TeaserDefaultTemplate.propTypes = {
|
|
89
|
+
data: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
90
|
+
isEditMode: PropTypes.bool,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default TeaserDefaultTemplate;
|
|
@@ -4,14 +4,8 @@ export const teaserSchemaEnhancer = ({ schema, formData, intl }) => {
|
|
|
4
4
|
return schema;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// Not sure why, but it was in the new one, check with blockModel3
|
|
8
|
-
// export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => {
|
|
9
|
-
// schema.fieldsets = schema.fieldsets.filter((item) => item.id !== 'styling');
|
|
10
|
-
// return schema;
|
|
11
|
-
// };
|
|
12
7
|
export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => {
|
|
13
|
-
|
|
14
|
-
schema.properties.styles.schema.fieldsets[0].fields = [];
|
|
8
|
+
schema.fieldsets = schema.fieldsets.filter((item) => item.id !== 'styling');
|
|
15
9
|
return schema;
|
|
16
10
|
};
|
|
17
11
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import isEmpty from 'lodash/isEmpty';
|
|
2
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
3
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
4
|
+
import type { Link } from '../../types';
|
|
5
|
+
|
|
6
|
+
type ColumnLinksProps = { links: Array<Link> };
|
|
7
|
+
|
|
8
|
+
const ColumnLinks = (props: ColumnLinksProps) => {
|
|
9
|
+
const { links } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<ul>
|
|
13
|
+
{links && Array.isArray(links)
|
|
14
|
+
? links.map((link) => {
|
|
15
|
+
if (isEmpty(link) || !link.href) return null;
|
|
16
|
+
|
|
17
|
+
const title = link.title || link.href[0]['title'];
|
|
18
|
+
const href = flattenToAppURL(link.href[0]?.['@id']);
|
|
19
|
+
|
|
20
|
+
if (!href) return null;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<li className="item" key={href}>
|
|
24
|
+
<UniversalLink href={href} openLinkInNewTab={link.openInNewTab}>
|
|
25
|
+
{title}
|
|
26
|
+
</UniversalLink>
|
|
27
|
+
</li>
|
|
28
|
+
);
|
|
29
|
+
})
|
|
30
|
+
: null}
|
|
31
|
+
</ul>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default ColumnLinks;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useSelector, shallowEqual } from 'react-redux';
|
|
2
|
+
import { Container } from '@plone/components';
|
|
3
|
+
import SlotRenderer from '@plone/volto/components/theme/SlotRenderer/SlotRenderer';
|
|
4
|
+
import type { Content } from '@plone/types';
|
|
5
|
+
|
|
6
|
+
type FormState = {
|
|
7
|
+
content: {
|
|
8
|
+
data: Content;
|
|
9
|
+
};
|
|
10
|
+
form: {
|
|
11
|
+
global: Content;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const Footer = () => {
|
|
16
|
+
const content = useSelector<FormState, Content>(
|
|
17
|
+
(state) => state.content.data,
|
|
18
|
+
shallowEqual,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<footer id="footer">
|
|
23
|
+
<SlotRenderer name="preFooter" content={content} />
|
|
24
|
+
<SlotRenderer name="footer" content={content} />
|
|
25
|
+
<Container className="post-footer">
|
|
26
|
+
<SlotRenderer name="postFooter" content={content} />
|
|
27
|
+
</Container>
|
|
28
|
+
</footer>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default Footer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Container } from '@plone/components';
|
|
2
|
+
import Copyright from './Copyright';
|
|
3
|
+
import Logo from '../../Logo/Logo';
|
|
4
|
+
import type { Content } from '@plone/types';
|
|
5
|
+
import { useLiveData } from '@kitconcept/volto-light-theme/helpers/useLiveData';
|
|
6
|
+
import type { SiteHeaderSettings } from '../../../types';
|
|
7
|
+
|
|
8
|
+
const Colophon = ({ content }: { content: Content }) => {
|
|
9
|
+
const logo = useLiveData<SiteHeaderSettings['logo']>(
|
|
10
|
+
content,
|
|
11
|
+
'voltolighttheme.header',
|
|
12
|
+
'logo',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Container className="colophon">
|
|
17
|
+
<div className="powered-by">Powered by Plone and Volto Light Theme</div>
|
|
18
|
+
<Copyright />
|
|
19
|
+
{!logo && <Logo />}
|
|
20
|
+
</Container>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Colophon;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
2
|
+
import { Container } from '@plone/components';
|
|
3
|
+
|
|
4
|
+
const messages = defineMessages({
|
|
5
|
+
copyright: {
|
|
6
|
+
id: 'Copyright',
|
|
7
|
+
defaultMessage: 'Copyright',
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const Copyright = () => {
|
|
12
|
+
const intl = useIntl();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Container className="default copyright">
|
|
16
|
+
<div className="footer-message">
|
|
17
|
+
<FormattedMessage
|
|
18
|
+
id="The {plonecms} is {copyright} 2000-{current_year} by the {plonefoundation} and friends."
|
|
19
|
+
defaultMessage="The {plonecms} is {copyright} 2000-{current_year} by the {plonefoundation} and friends."
|
|
20
|
+
values={{
|
|
21
|
+
plonecms: (
|
|
22
|
+
<FormattedMessage
|
|
23
|
+
id="Plone{reg} Open Source CMS/WCM"
|
|
24
|
+
defaultMessage="Plone{reg} Open Source CMS/WCM"
|
|
25
|
+
values={{ reg: <sup>®</sup> }}
|
|
26
|
+
/>
|
|
27
|
+
),
|
|
28
|
+
copyright: (
|
|
29
|
+
<abbr title={intl.formatMessage(messages.copyright)}>©</abbr>
|
|
30
|
+
),
|
|
31
|
+
current_year: new Date().getFullYear(),
|
|
32
|
+
plonefoundation: (
|
|
33
|
+
<a className="item" href="https://plone.org/foundation">
|
|
34
|
+
<FormattedMessage
|
|
35
|
+
id="Plone Foundation"
|
|
36
|
+
defaultMessage="Plone Foundation"
|
|
37
|
+
/>
|
|
38
|
+
</a>
|
|
39
|
+
),
|
|
40
|
+
}}
|
|
41
|
+
/>{' '}
|
|
42
|
+
<br />
|
|
43
|
+
<FormattedMessage
|
|
44
|
+
id="Distributed under the {license}."
|
|
45
|
+
defaultMessage="Distributed under the {license}."
|
|
46
|
+
values={{
|
|
47
|
+
license: (
|
|
48
|
+
<a
|
|
49
|
+
className="item"
|
|
50
|
+
href="https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
|
|
51
|
+
>
|
|
52
|
+
<FormattedMessage
|
|
53
|
+
id="GNU GPL license"
|
|
54
|
+
defaultMessage="GNU GPL v2 license"
|
|
55
|
+
/>
|
|
56
|
+
</a>
|
|
57
|
+
),
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
</Container>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default Copyright;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Container } from '@plone/components';
|
|
2
|
+
import Logo from '@plone/volto/components/theme/Logo/Logo';
|
|
3
|
+
import { useLiveData } from '@kitconcept/volto-light-theme/helpers/useLiveData';
|
|
4
|
+
import ColumnLinks from '../ColumnLinks';
|
|
5
|
+
import type { SiteFooterSettings } from '../../../types';
|
|
6
|
+
import type { Content } from '@plone/types';
|
|
7
|
+
|
|
8
|
+
const CoreFooter = ({ content }: { content: Content }) => {
|
|
9
|
+
const footer_address = useLiveData<SiteFooterSettings['footer_address']>(
|
|
10
|
+
content,
|
|
11
|
+
'kitconcept.footer',
|
|
12
|
+
'footer_address',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const footer_column_left_header = useLiveData<
|
|
16
|
+
SiteFooterSettings['footer_column_left_header']
|
|
17
|
+
>(content, 'kitconcept.footer', 'footer_column_left_header');
|
|
18
|
+
const footer_column_left = useLiveData<
|
|
19
|
+
SiteFooterSettings['footer_column_left']
|
|
20
|
+
>(content, 'kitconcept.footer', 'footer_column_left');
|
|
21
|
+
|
|
22
|
+
const footer_column_middle_header = useLiveData<
|
|
23
|
+
SiteFooterSettings['footer_column_middle_header']
|
|
24
|
+
>(content, 'kitconcept.footer', 'footer_column_middle_header');
|
|
25
|
+
const footer_column_middle = useLiveData<
|
|
26
|
+
SiteFooterSettings['footer_column_middle']
|
|
27
|
+
>(content, 'kitconcept.footer', 'footer_column_middle');
|
|
28
|
+
|
|
29
|
+
const footer_column_right_header = useLiveData<
|
|
30
|
+
SiteFooterSettings['footer_column_right_header']
|
|
31
|
+
>(content, 'kitconcept.footer', 'footer_column_right_header');
|
|
32
|
+
const footer_column_right = useLiveData<
|
|
33
|
+
SiteFooterSettings['footer_column_right']
|
|
34
|
+
>(content, 'kitconcept.footer', 'footer_column_right');
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Container className="footer">
|
|
38
|
+
<Container className="default">
|
|
39
|
+
<div className="footer-grid">
|
|
40
|
+
<div className="address-column">
|
|
41
|
+
<Logo />
|
|
42
|
+
<p
|
|
43
|
+
style={{ whiteSpace: 'pre-line' }}
|
|
44
|
+
dangerouslySetInnerHTML={{
|
|
45
|
+
__html: footer_address,
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
{footer_column_left && (
|
|
51
|
+
<div className="column-left">
|
|
52
|
+
{footer_column_left_header && (
|
|
53
|
+
<h2>{footer_column_left_header}</h2>
|
|
54
|
+
)}
|
|
55
|
+
<ColumnLinks links={footer_column_left} />
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
|
|
59
|
+
{footer_column_middle && (
|
|
60
|
+
<div className="column-middle">
|
|
61
|
+
{footer_column_middle_header && (
|
|
62
|
+
<h2>{footer_column_middle_header}</h2>
|
|
63
|
+
)}
|
|
64
|
+
<ColumnLinks links={footer_column_middle} />
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
|
|
68
|
+
{footer_column_right && (
|
|
69
|
+
<div className="column-right">
|
|
70
|
+
{footer_column_right_header && (
|
|
71
|
+
<h2>{footer_column_right_header}</h2>
|
|
72
|
+
)}
|
|
73
|
+
<ColumnLinks links={footer_column_right} />
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
</Container>
|
|
78
|
+
</Container>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default CoreFooter;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { FormattedMessage } from 'react-intl';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
4
|
+
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
|
|
5
|
+
import { Container } from '@plone/components';
|
|
6
|
+
import { useLiveData } from '@kitconcept/volto-light-theme/helpers/useLiveData';
|
|
7
|
+
import LinkList from '../../../primitives/LinkList';
|
|
8
|
+
import type {
|
|
9
|
+
PloneGobrSocialMediaSettings,
|
|
10
|
+
SiteFooterSettings,
|
|
11
|
+
} from '../../../types';
|
|
12
|
+
import type { Content } from '@plone/types';
|
|
13
|
+
import SlotRenderer from '@plone/volto/components/theme/SlotRenderer/SlotRenderer';
|
|
14
|
+
|
|
15
|
+
const FollowUsPostFooterLogoAndLinks = ({ content }: { content: Content }) => {
|
|
16
|
+
const social_links = useLiveData<
|
|
17
|
+
PloneGobrSocialMediaSettings['social_links']
|
|
18
|
+
>(content, 'plonegovbr.socialmedia.settings', 'social_links');
|
|
19
|
+
|
|
20
|
+
const footer_links = useLiveData<SiteFooterSettings['footer_links']>(
|
|
21
|
+
content,
|
|
22
|
+
'voltolighttheme.footer',
|
|
23
|
+
'footer_links',
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const footer_logo = useLiveData<SiteFooterSettings['footer_logo']>(
|
|
27
|
+
content,
|
|
28
|
+
'kitconcept.footer',
|
|
29
|
+
'footer_logo',
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const footerLogoSrc = footer_logo?.data
|
|
33
|
+
? `data:${footer_logo['content-type']};base64,${footer_logo.data}`
|
|
34
|
+
: flattenToAppURL(footer_logo?.download);
|
|
35
|
+
|
|
36
|
+
return content ? (
|
|
37
|
+
<Container
|
|
38
|
+
className={cx('default follow-us-links-and-logo', {
|
|
39
|
+
'no-logo': !footer_logo?.data && !footer_logo?.download,
|
|
40
|
+
})}
|
|
41
|
+
>
|
|
42
|
+
<div className="followus-and-links">
|
|
43
|
+
{social_links?.length > 0 && (
|
|
44
|
+
<div className="follow-us">
|
|
45
|
+
<span>
|
|
46
|
+
<FormattedMessage id="Follow us:" defaultMessage="Follow us:" />
|
|
47
|
+
</span>
|
|
48
|
+
<SlotRenderer name="followUs" content={content} />
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
{footer_links?.length > 0 && (
|
|
52
|
+
<div className="footer-links">
|
|
53
|
+
<SlotRenderer name="footerLinks" content={content} />
|
|
54
|
+
<LinkList links={footer_links} />
|
|
55
|
+
</div>
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
{footer_logo?.data || footer_logo?.download ? (
|
|
59
|
+
<div className="footer-logo">
|
|
60
|
+
<span>
|
|
61
|
+
<FormattedMessage
|
|
62
|
+
id="Sponsored by:"
|
|
63
|
+
defaultMessage="Sponsored by:"
|
|
64
|
+
/>
|
|
65
|
+
</span>
|
|
66
|
+
{/* @ts-ignore */}
|
|
67
|
+
<ConditionalLink
|
|
68
|
+
condition={content?.footer_logo_link}
|
|
69
|
+
to={content?.footer_logo_link}
|
|
70
|
+
openLinkInNewTab={true}
|
|
71
|
+
>
|
|
72
|
+
<img src={footerLogoSrc} alt="Sponsor Logo" />
|
|
73
|
+
</ConditionalLink>
|
|
74
|
+
</div>
|
|
75
|
+
) : null}
|
|
76
|
+
</Container>
|
|
77
|
+
) : null;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default FollowUsPostFooterLogoAndLinks;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useSelector, shallowEqual } from 'react-redux';
|
|
2
|
+
import { useLiveData } from '@kitconcept/volto-light-theme/helpers/useLiveData';
|
|
3
|
+
import LogosContainer from '../../LogosContainer/LogosContainer';
|
|
4
|
+
import type { Content } from '@plone/types';
|
|
5
|
+
import type { SiteFooterSettings } from '../../../types';
|
|
6
|
+
|
|
7
|
+
type FormState = {
|
|
8
|
+
content: {
|
|
9
|
+
data: Content;
|
|
10
|
+
};
|
|
11
|
+
form: {
|
|
12
|
+
global: Content;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const FooterLogos = () => {
|
|
17
|
+
const content = useSelector<FormState, Content>(
|
|
18
|
+
(state) => state.content.data,
|
|
19
|
+
shallowEqual,
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const footer_logos = useLiveData<SiteFooterSettings['footer_logos']>(
|
|
23
|
+
content,
|
|
24
|
+
'voltolighttheme.footer',
|
|
25
|
+
'footer_logos',
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const footer_logos_size = useLiveData<
|
|
29
|
+
SiteFooterSettings['footer_logos_size']
|
|
30
|
+
>(content, 'voltolighttheme.footer', 'footer_logos_size');
|
|
31
|
+
const footer_logos_container_width = useLiveData<
|
|
32
|
+
SiteFooterSettings['footer_logos_container_width']
|
|
33
|
+
>(content, 'voltolighttheme.footer', 'footer_logos_container_width');
|
|
34
|
+
|
|
35
|
+
return footer_logos?.length > 0 ? (
|
|
36
|
+
<LogosContainer
|
|
37
|
+
logos={footer_logos}
|
|
38
|
+
logos_size={footer_logos_size}
|
|
39
|
+
logos_container_width={footer_logos_container_width}
|
|
40
|
+
/>
|
|
41
|
+
) : null;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default FooterLogos;
|