1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

More footer links (#1322)

* tweaked footer layout

* add more links

* source links from content file
This commit is contained in:
Matthias Kretschmann 2022-04-05 18:08:12 +01:00 committed by GitHub
parent fc2681231b
commit a9e1776499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 128 additions and 57 deletions

16
content/footer.json Normal file
View File

@ -0,0 +1,16 @@
{
"links": [
{
"name": "Docs",
"url": "https://docs.oceanprotocol.com"
},
{
"name": "GitHub",
"url": "https://github.com/oceanprotocol"
},
{
"name": "Discord",
"url": "https://discord.gg/TnXjkR5"
}
]
}

View File

@ -1,6 +1,7 @@
.buildId { .buildId {
display: inline-block; display: block;
font-size: var(--font-size-mini); font-size: var(--font-size-mini);
margin-bottom: var(--spacer); margin-bottom: var(--spacer);
font-family: var(--font-family-monospace); font-family: var(--font-family-monospace);
text-align: center;
} }

View File

@ -1,38 +1,57 @@
.content { .footer {
padding: var(--spacer) calc(var(--spacer) / 2); padding: var(--spacer) calc(var(--spacer) / 2);
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
max-width: var(--layout-max-width); max-width: var(--layout-max-width);
color: var(--brand-grey-light);
font-size: var(--font-size-small);
} }
.content a, .footer a,
.content button { .footer button {
color: inherit; color: inherit;
} }
.content button { .footer button {
text-transform: none; text-transform: none;
transform: none !important; transform: none !important;
font-weight: var(--font-weight-normal); font-weight: var(--font-weight-normal);
} }
.content a:hover, .footer a:hover,
.content a:focus, .footer a:focus,
.content button:hover, .footer button:hover,
.content button:focus { .footer button:focus {
color: var(--color-primary); color: var(--color-primary);
} }
.content p { .copyright > div,
.copyright > div > p {
display: inline; display: inline;
} }
.copyright div { .copyright,
display: inline-block; .grid > div:first-child {
}
.footer {
color: var(--brand-grey-light);
font-size: var(--font-size-small);
text-align: center; text-align: center;
} }
.grid {
display: grid;
gap: var(--spacer);
}
@media (min-width: 40rem) {
.grid {
display: grid;
gap: var(--spacer);
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.grid > div:first-child {
text-align: left;
}
.copyright {
text-align: right;
}
}

View File

@ -2,56 +2,23 @@ import React, { ReactElement } from 'react'
import styles from './Footer.module.css' import styles from './Footer.module.css'
import Markdown from '@shared/Markdown' import Markdown from '@shared/Markdown'
import { useSiteMetadata } from '@hooks/useSiteMetadata' import { useSiteMetadata } from '@hooks/useSiteMetadata'
import Link from 'next/link'
import MarketStats from './MarketStats' import MarketStats from './MarketStats'
import BuildId from './BuildId' import BuildId from './BuildId'
import { useUserPreferences } from '@context/UserPreferences' import Links from './Links'
import Button from '@shared/atoms/Button'
import { useGdprMetadata } from '@hooks/useGdprMetadata'
export default function Footer(): ReactElement { export default function Footer(): ReactElement {
const { copyright, appConfig } = useSiteMetadata() const { copyright } = useSiteMetadata()
const { setShowPPC } = useUserPreferences()
const { privacyPolicySlug } = useUserPreferences()
const cookies = useGdprMetadata()
const year = new Date().getFullYear() const year = new Date().getFullYear()
return ( return (
<footer className={styles.footer}> <footer className={styles.footer}>
<div className={styles.content}> <BuildId />
<BuildId /> <MarketStats />
<MarketStats />
<div className={styles.grid}>
<Links />
<div className={styles.copyright}> <div className={styles.copyright}>
© {year} <Markdown text={copyright} /> © {year} <Markdown text={copyright} />
<br />
<Link href="/imprint">
<a>Imprint</a>
</Link>
{' — '}
<Link href="/terms">
<a>Terms</a>
</Link>
{' — '}
<Link href={privacyPolicySlug}>
<a>Privacy</a>
</Link>
{appConfig.privacyPreferenceCenter === 'true' && (
<>
{' — '}
<Button
style="text"
size="small"
className="link"
onClick={() => {
setShowPPC(true)
}}
>
{cookies.optionalCookies ? 'Cookie Settings' : 'Cookies'}
</Button>
</>
)}
</div> </div>
</div> </div>
</footer> </footer>

View File

@ -0,0 +1,12 @@
.links a {
text-transform: none;
font-family: var(--font-family-base);
font-weight: var(--font-weight-base);
}
.links svg {
display: inline;
fill: currentColor;
width: 0.6em;
height: 0.6em;
}

View File

@ -0,0 +1,55 @@
import { useUserPreferences } from '@context/UserPreferences'
import { useGdprMetadata } from '@hooks/useGdprMetadata'
import { useSiteMetadata } from '@hooks/useSiteMetadata'
import Button from '@shared/atoms/Button'
import Link from 'next/link'
import React from 'react'
import content from '../../../content/footer.json'
import External from '@images/external.svg'
import styles from './Links.module.css'
export default function Links() {
const { appConfig } = useSiteMetadata()
const { setShowPPC, privacyPolicySlug } = useUserPreferences()
const cookies = useGdprMetadata()
return (
<div className={styles.links}>
{content.links.map(({ name, url }) => (
<>
<Button style="text" size="small" href={url}>
{name} <External />
</Button>
{' — '}
</>
))}
<Link href="/imprint">
<a>Imprint</a>
</Link>
{' — '}
<Link href="/terms">
<a>Terms</a>
</Link>
{' — '}
<Link href={privacyPolicySlug}>
<a>Privacy</a>
</Link>
{appConfig.privacyPreferenceCenter === 'true' && (
<>
{' — '}
<Button
style="text"
size="small"
className="link"
onClick={() => {
setShowPPC(true)
}}
>
{cookies.optionalCookies ? 'Cookie Settings' : 'Cookies'}
</Button>
</>
)}
</div>
)
}

View File

@ -1,5 +1,6 @@
.stats { .stats {
margin-bottom: calc(var(--spacer) * 2); margin-bottom: calc(var(--spacer) * 2);
text-align: center;
} }
/* specificity sledgehammer override without !important */ /* specificity sledgehammer override without !important */