Skip to content

Commit

Permalink
feat(footer): allow passing main copy to the footer
Browse files Browse the repository at this point in the history
Allow an application to pass main copy to the footer
  • Loading branch information
admmasters committed Dec 12, 2022
1 parent 61334ea commit f9490eb
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
34 changes: 26 additions & 8 deletions src/components/molecules/ZopaFooter/ZopaFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ const StyledLink = styled(Link)`
export interface FooterProps extends HTMLAttributes<HTMLDivElement> {
baseUrl?: string;
renderLink?: (props: LinkProps) => React.ReactNode;
mainCustomLegalCopy?: string;
additionalCopy?: string[];
}

const ZopaFooter = ({
baseUrl = 'https://www.zopa.com',
renderLink = (props: LinkProps) => <StyledLink {...props} />,
additionalCopy = [],
mainCustomLegalCopy,
...rest
}: FooterProps) => {
const theme = useThemeContext();
Expand Down Expand Up @@ -162,14 +164,9 @@ const ZopaFooter = ({
/>
</SocialBlock>
)}
{theme.footer.showLegalBlock && (
{theme.footer.showLegalBlock ? (
<LegalBlock xs={12} l={theme.footer.legalBlock.isFullWidth ? 12 : 5} theme={theme}>
<Text as="p" color={theme.footer.legalBlock.color} size="small" className="mb-4">
Zopa Bank Limited is authorised by the Prudential Regulation Authority and regulated by the Financial
Conduct Authority and the Prudential Regulation Authority, and entered on the Financial Services
Register (800542). Zopa Bank Limited (10627575) is incorporated in England &amp; Wales and has its
registered office at: 1st Floor, Cottons Centre, Tooley Street, London, SE1 2QG.
</Text>
{mainCustomLegalCopy ? <MainCustomLegalCopy copy={mainCustomLegalCopy} /> : <MainZopaLegalCopy />}
<Text as="p" color={theme.footer.legalBlock.color} size="small" className="mb-4">
© Zopa Bank Limited {new Date().getFullYear()} All rights reserved. 'Zopa' is a trademark of Zopa Bank
Limited.
Expand All @@ -195,11 +192,32 @@ const ZopaFooter = ({
</Text>
))}
</LegalBlock>
)}
) : null}
</FlexRow>
</FlexContainer>
</Footer>
);
};

function MainZopaLegalCopy() {
const theme = useThemeContext();
return (
<Text as="p" color={theme.footer.legalBlock.color} size="small" className="mb-4">
Zopa Bank Limited is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct
Authority and the Prudential Regulation Authority, and entered on the Financial Services Register (800542). Zopa
Bank Limited (10627575) is incorporated in England &amp; Wales and has its registered office at: 1st Floor,
Cottons Centre, Tooley Street, London, SE1 2QG.
</Text>
);
}

function MainCustomLegalCopy({ copy }: { copy: string }) {
const theme = useThemeContext();
return (
<Text as="p" color={theme.footer.legalBlock.color} size="small" className="mb-4">
{copy}
</Text>
);
}

export default ZopaFooter;
21 changes: 21 additions & 0 deletions src/components/molecules/ZopaFooter/ZopaMainLegalBlock.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as React from 'react';
import { useThemeContext } from '../../styles/Theme';
import Text from '../../atoms/Text/Text';

export default function ZopaMainLegalBlockCopy() {
const theme = useThemeContext();
return (
<Text
as="p"
color={theme.footer.legalBlock.color}
size="small"
className="mb-4"
data-automation="ZA.ZopaFooterMainLegalBlockCopy"
>
Zopa Bank Limited is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct
Authority and the Prudential Regulation Authority, and entered on the Financial Services Register (800542). Zopa
Bank Limited (10627575) is incorporated in England &amp; Wales and has its registered office at: 1st Floor,
Cottons Centre, Tooley Street, London, SE1 2QG.
</Text>
);
}

0 comments on commit f9490eb

Please sign in to comment.