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

Add privacy links & copyright to the footer #527

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all 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: 4 additions & 1 deletion cypress/e2e/keyboard-navigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ describe('keyboard navigation and accessibility', () => {
pressTabAndAssertFocusOutline(() => cy.findAllByText('Docs').filter(':visible').closest('a'));

pressTabAndAssertFocusOutline(() => cy.findByTestId('connect-wallet-staking-btn'));
pressTabAndAssertFocusOutline(() => cy.findByText('About API3'));
pressTabAndAssertFocusOutline(() => cy.findByText('Api3.org'));
pressTabAndAssertFocusOutline(() => cy.findByText('Error Reporting'));
pressTabAndAssertFocusOutline(() => cy.findByText('Github'));
pressTabAndAssertFocusOutline(() => cy.findByText('Privacy Policy'));
pressTabAndAssertFocusOutline(() => cy.findByText('Privacy and Cookies'));
pressTabAndAssertFocusOutline(() => cy.findByText('Terms and Conditions'));

pressTabAndAssertFocusOutline(() => cy.dataCy('api3-logo')); // Completes the TAB cycle
});
Expand Down
72 changes: 61 additions & 11 deletions src/components/layout/layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@
position: relative;
align-items: center;
justify-content: center;
height: 196px;
height: 244px;

&Content {
&Rows {
width: calc(100% - 32px);
max-width: 468px;
}

&FirstRow {
display: flex;
padding-top: 44px;
padding: 44px 0 24px 0;
justify-content: center;

a {
display: flex;
Expand Down Expand Up @@ -76,22 +82,66 @@
background: $gradient-medium-light;
}
}

&SecondRow {
display: flex;
flex-direction: column-reverse;
align-items: center;
gap: 24px;
padding: 24px 0 64px 0;
border-top: 1px solid $color-blue-25;
width: 100%;

.privacyLinks {
display: flex;
gap: 16px;
}

a {
text-decoration: none;
box-sizing: border-box;
@include font-overline-2;
@include menu-link-secondary;
}

.copyright {
@include font-body-18;
color: $color-dark-blue-50;
}
}
}

@media (min-width: $md) {
.footer {
height: 140px;
height: 238px;

&Content {
padding-top: 64px;
&Rows {
width: calc(100% - 192px);
max-width: unset;
}

a {
@include font-body-15;
}
a,
.copyright {
@include font-body-15;
}

& > *,
&FirstRow {
padding: 64px 0 32px 0;

& > button,
& > a {
padding: 0 40px;
padding: 0 40px !important;
}
}

&SecondRow {
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 32px 0 64px 0;

.privacyLinks {
gap: 24px;
}
}
}
Expand Down
61 changes: 41 additions & 20 deletions src/components/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ErrorReportingNotice from './error-reporting-notice';
import { DesktopMenu } from '../menu';
import ExternalLink from '../external-link';
import { ALLOW_ANALYTICS, ALLOW_ERROR_REPORTING } from '../../utils/analytics';
import { links } from '../../utils/links';

type Props = {
children: ReactNode;
Expand Down Expand Up @@ -35,11 +36,19 @@ export const BaseLayout = ({ children, title }: BaseLayoutProps) => {
);

const footerLinks = [
{ text: 'About API3', href: 'https://api3.org/' },
{ text: 'Api3.org', href: links.API3_ORG },
{ text: 'Error Reporting', onClick: () => setShowNotice(true) },
{ text: 'Github', href: 'https://github.com/api3dao/api3-dao-dashboard' },
{ text: 'Github', href: links.GITHUB },
];

const footerLinksSecondRow = [
{ text: 'Privacy Policy', href: links.PRIVACY_POLICY },
{ text: 'Privacy and Cookies', href: links.PRIVACY_AND_COOKIES },
{ text: 'Terms and Conditions', href: links.TERMS_AND_CONDITIONS },
];

const actualYear = new Date().getFullYear();

return (
<>
<Helmet>
Expand All @@ -56,24 +65,36 @@ export const BaseLayout = ({ children, title }: BaseLayoutProps) => {
{showNotice ? (
<ErrorReportingNotice onShowNotice={setShowNotice} />
) : (
<div className={styles.footerContent}>
{footerLinks.map((link) =>
link.href ? (
<ExternalLink href={link.href} key={link.text}>
{link.text}
</ExternalLink>
) : (
<Button
key={link.text}
type="menu-link-secondary"
onClick={link.onClick}
size="xs"
md={{ size: 'sm' }}
>
{link.text}
</Button>
)
)}
<div className={styles.footerRows}>
<div className={styles.footerFirstRow}>
{footerLinks.map((link) =>
link.href ? (
<ExternalLink href={link.href} key={link.text}>
{link.text}
</ExternalLink>
) : (
<Button
key={link.text}
type="menu-link-secondary"
onClick={link.onClick}
size="xs"
md={{ size: 'sm' }}
>
{link.text}
</Button>
)
)}
</div>
<div className={styles.footerSecondRow}>
<div className={styles.copyright}>&copy; {actualYear} API3 Foundation</div>
<div className={styles.privacyLinks}>
{footerLinksSecondRow.map((link) => (
<ExternalLink href={link.href} key={link.text}>
{link.text}
</ExternalLink>
))}
</div>
</div>
</div>
)}
</footer>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/fonts.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
font-family: Karla;
font-size: 10px;
font-style: normal;
font-weight: 700;
font-weight: 400;
line-height: 170%; /* 17px */
}

Expand Down
6 changes: 5 additions & 1 deletion src/utils/links.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const links = {
SENTRY: 'https://sentry.io/',
API3_ORG: 'https://api3.org/',
GITHUB: 'https://github.com/api3dao/api3-dao-dashboard',
PRIVACY_AND_COOKIES: 'https://api3.org/privacy-and-cookies/',
PRIVACY_POLICY: 'https://api3.org/privacy-policy/',
SENTRY: 'https://sentry.io/',
TERMS_AND_CONDITIONS: 'https://api3.org/terms-and-conditions/',
};
Loading