diff --git a/docs/utils.md b/docs/utils.md index 1793de9c9..7ee969274 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -5,13 +5,13 @@ _Hide Visually_ how to use in your styled component `export const Component = styled.span'${hideVisually};';` -_whiteListed_ +_allowListed_ -`import { whiteListed } from '@comicrelief/component-library';` +`import { allowListed } from '@comicrelief/component-library';` -`whiteListed(url)` +`allowListed(url)` -Check if a url is whiteListed. Used to check links and change link target. +Check if a url is allowListed. Used to check links and change link target. _Z Index_ diff --git a/src/components/Atoms/Link/Link.js b/src/components/Atoms/Link/Link.js index 20d7ebf49..564648656 100755 --- a/src/components/Atoms/Link/Link.js +++ b/src/components/Atoms/Link/Link.js @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import StyledLink, { HelperText, IconWrapper } from './Link.style'; -import whiteListed from '../../../utils/whiteListed'; +import allowListed from '../../../utils/allowListed'; import { getDomain } from '../../../utils/internalLinkHelper'; let window = ''; @@ -22,7 +22,7 @@ const Link = ({ const [documentHost, setDocumentHost] = useState(''); /** * If we haven't specifically set the target via props, check if - * this is an internal link OR on our whitelist before making it a '_self' link + * this is an internal link OR on our allowList before making it a '_self' link */ if (target === null) { // Use our helper function to determine the raw domains to compare @@ -30,7 +30,7 @@ const Link = ({ const linkDomain = getDomain(href); // Additional check for applications that need more control - const isWhiteListOverridden = rest.overrideWhiteList === true; + const isallowListOverridden = rest.overrideallowList === true; /** * If the link has no domain supplied (likely '/' or '#') @@ -38,9 +38,9 @@ const Link = ({ * in a new tab */ const isExternalLink = linkDomain !== '' && (currentDomain !== linkDomain); - const isWhiteListed = whiteListed(href); + const isallowListed = allowListed(href); - window = isExternalLink && (isWhiteListOverridden || !isWhiteListed) ? '_blank' : '_self'; + window = isExternalLink && (isallowListOverridden || !isallowListed) ? '_blank' : '_self'; } else { window = target === 'blank' ? '_blank' : '_self'; } diff --git a/src/components/Organisms/Footer/Footer.js b/src/components/Organisms/Footer/Footer.js index ff088ff42..37b62c2e7 100644 --- a/src/components/Organisms/Footer/Footer.js +++ b/src/components/Organisms/Footer/Footer.js @@ -52,7 +52,7 @@ Footer.propTypes = { navItems: PropTypes.objectOf(PropTypes.shape), footerCopy: PropTypes.string, campaign: PropTypes.string, - overrideWhiteList: PropTypes.bool, + overrideallowList: PropTypes.bool, additionalLegalLine: PropTypes.string }; @@ -60,7 +60,7 @@ Footer.defaultProps = { navItems: {}, footerCopy: '', campaign: 'Comic Relief', - overrideWhiteList: false, + overrideallowList: false, additionalLegalLine: '' }; diff --git a/src/components/Organisms/Footer/Footer.md b/src/components/Organisms/Footer/Footer.md index 0bcc49974..33e3c0602 100644 --- a/src/components/Organisms/Footer/Footer.md +++ b/src/components/Organisms/Footer/Footer.md @@ -8,12 +8,12 @@ import footerCopy from './data/footerCopy';

Standard footer