Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cobranded footer #1144

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flat-zebras-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@zopauk/react-components': minor
---

zopa footer to accept co branding
24 changes: 20 additions & 4 deletions src/components/molecules/ZopaFooter/ZopaFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React, { HTMLAttributes } from 'react';
import FlexRow from '../../layout/FlexRow/FlexRow';
import FlexCol from '../../layout/FlexCol/FlexCol';
import { useThemeContext } from '../../styles/Theme';
import { useThemeContext, zopaTheme } from '../../styles/Theme';
import twitter from '../../../content/images/social/twitter.svg';
import facebook from '../../../content/images/social/facebook.svg';
import linkedin from '../../../content/images/social/linkedin.svg';
Expand Down Expand Up @@ -92,7 +92,7 @@
export const footerLinkStyle = css`
font-weight: ${typography.weights.regular};
text-decoration: none;

color: ${colors.actionPlain};
&:hover,
&:active {
text-decoration: underline;
Expand Down Expand Up @@ -394,6 +394,8 @@
mainCustomLegalCopy?: string | string[];
additionalCopy?: string[];
customFooterLinks?: CustomFooterLink[];
isCobranded?: boolean;
MainCobrandedLegalCopy?: any; //TODO: add type
}

const ZopaFooter = ({
Expand All @@ -402,9 +404,17 @@
additionalCopy = [],
mainCustomLegalCopy,
customFooterLinks,
isCobranded,
MainCobrandedLegalCopy,
...rest
}: FooterProps) => {
const theme = useThemeContext();
const themeContext = useThemeContext();
let theme;

Check failure on line 412 in src/components/molecules/ZopaFooter/ZopaFooter.tsx

View workflow job for this annotation

GitHub Actions / Test and release

Variable 'theme' implicitly has type 'any' in some locations where its type cannot be determined.
if (isCobranded) {
theme = zopaTheme;
} else {
theme = themeContext;
}

return (
<Footer data-automation="ZA.footer" theme={theme} {...rest} className={theme.footer.className}>
Expand All @@ -421,11 +431,17 @@
)}
{theme.footer.showLegalBlock ? (
<LegalBlock xs={12} l={theme.footer.legalBlock.isFullWidth ? 12 : 4} theme={theme}>
{mainCustomLegalCopy ? <MainCustomLegalCopy copy={mainCustomLegalCopy} /> : <MainZopaLegalCopy />}
{mainCustomLegalCopy ? (
<MainCustomLegalCopy copy={mainCustomLegalCopy} />
) : isCobranded ? (
<MainCobrandedLegalCopy />
) : (
<MainZopaLegalCopy />
)}
{additionalCopy.map((copy, i) => (
<Text
as="p"
color={theme.footer.legalBlock.color}

Check failure on line 444 in src/components/molecules/ZopaFooter/ZopaFooter.tsx

View workflow job for this annotation

GitHub Actions / Test and release

Variable 'theme' implicitly has an 'any' type.
size="small"
key={i}
className={i > additionalCopy.length ? 'mb-0' : 'mb-4'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ exports[`<ZopaFooter /> renders the component with no a11y violations 1`] = `
font-weight: 400;
-webkit-text-decoration: none;
text-decoration: none;
color: #3B46C4;
}

.c7:hover,
Expand Down
Loading