diff --git a/client/src/components/Footer/index.js b/client/src/components/Footer/index.js index 1ad82b3a5a..7fc3bdd71c 100644 --- a/client/src/components/Footer/index.js +++ b/client/src/components/Footer/index.js @@ -6,9 +6,7 @@ import { Grid, Row, Col } from '@freecodecamp/react-bootstrap'; import './footer.css'; const propTypes = { - children: PropTypes.any, - external: PropTypes.bool, - to: PropTypes.string.isRequired + children: PropTypes.any }; const ColHeader = ({ children, ...other }) => ( @@ -18,8 +16,14 @@ const ColHeader = ({ children, ...other }) => ( ); ColHeader.propTypes = propTypes; +const linkPropTypes = { + children: PropTypes.any, + external: PropTypes.bool, + to: PropTypes.string.isRequired +}; + const Link = ({ children, to, external, ...other }) => { - if (!external && /^\/(?!\/)/.test(to)) { + if (!external && /^\/[^/]?/.test(to)) { return ( {children} @@ -33,7 +37,7 @@ const Link = ({ children, to, external, ...other }) => { ); }; -Link.propTypes = propTypes; +Link.propTypes = linkPropTypes; function Footer() { return ( @@ -55,7 +59,7 @@ function Footer() {

Donations to freeCodeCamp go toward our education initiatives, and help pay for servers, services, and staff. You can  - + make a tax-deductible donation here .