Skip to content

Commit

Permalink
feat: can disable all actions from footer - refs #253198
Browse files Browse the repository at this point in the history
  • Loading branch information
tedw87 authored Jun 1, 2023
1 parent 370dcbf commit ab52ee8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/customizations/volto/components/theme/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useSelector, shallowEqual } from 'react-redux';
import { flattenToAppURL } from '@plone/volto/helpers';
import EEAFooter from '@eeacms/volto-eea-design-system/ui/Footer/Footer';
import config from '@plone/volto/registry';
import isArray from 'lodash/isArray';

const Footer = () => {
const { eea } = config.settings;
Expand All @@ -28,15 +29,15 @@ const Footer = () => {
shallowEqual,
);
// ZMI > portal_actions > footer_actions
const actions = footerActions.length
const actions = isArray(footerActions)
? footerActions.map((action) => ({
title: action.title,
link: flattenToAppURL(action.url),
}))
: eea.footerOpts.actions;

// ZMI > portal_actions > copyright_actions
const copyright = copyrightActions.length
const copyright = isArray(copyrightActions)
? copyrightActions.map((action) => ({
title: action.title,
site: action.title,
Expand All @@ -45,7 +46,7 @@ const Footer = () => {
: eea.footerOpts.copyright;

// ZMI > portal_actions > social_actions
const social = socialActions.length
const social = isArray(socialActions)
? socialActions.map((action) => ({
name: action.id,
icon: action.icon,
Expand All @@ -54,7 +55,7 @@ const Footer = () => {
: eea.footerOpts.social;

// ZMI > portal_actions > contact_actions
const contacts = contactActions.length
const contacts = isArray(contactActions)
? contactActions.map((action, idx) => ({
text: action.title,
icon: action.icon,
Expand Down

0 comments on commit ab52ee8

Please sign in to comment.