2019-11-26 18:25:42 +01:00
|
|
|
import React, { memo } from 'react'
|
2019-04-16 03:59:21 +02:00
|
|
|
import PropTypes from 'prop-types'
|
2019-11-10 13:17:13 +01:00
|
|
|
import { graphql, useStaticQuery } from 'gatsby'
|
2019-11-25 13:46:44 +01:00
|
|
|
import loadable from '@loadable/component'
|
2018-09-15 19:51:10 +02:00
|
|
|
import LogoUnit from '../molecules/LogoUnit'
|
2018-05-12 22:58:16 +02:00
|
|
|
import Networks from '../molecules/Networks'
|
2020-03-07 03:11:52 +01:00
|
|
|
import styles from './Footer.module.css'
|
2019-11-11 21:46:14 +01:00
|
|
|
import { useMeta } from '../../hooks/use-meta'
|
2018-04-02 23:22:48 +02:00
|
|
|
|
2019-11-25 13:46:44 +01:00
|
|
|
const LazyVcard = loadable(() => import('../atoms/Vcard'))
|
|
|
|
|
2018-09-06 11:34:50 +02:00
|
|
|
const query = graphql`
|
2020-06-01 12:08:35 +02:00
|
|
|
query FooterQuery {
|
2018-09-06 11:34:50 +02:00
|
|
|
portfolioJson {
|
|
|
|
bugs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
2019-11-10 13:17:13 +01:00
|
|
|
const FooterMarkup = ({ pkg, meta, year }) => (
|
|
|
|
<footer className={`h-card ${styles.footer}`}>
|
|
|
|
<LogoUnit minimal />
|
2019-11-12 22:20:34 +01:00
|
|
|
<Networks small />
|
2019-11-10 13:17:13 +01:00
|
|
|
|
|
|
|
<p className={styles.actions}>
|
2019-11-25 13:46:44 +01:00
|
|
|
<LazyVcard />
|
2019-11-10 13:17:13 +01:00
|
|
|
<a className="u-key" href={meta.gpg}>
|
|
|
|
PGP/GPG key
|
|
|
|
</a>
|
|
|
|
<a href={pkg.bugs}>Found a bug?</a>
|
|
|
|
</p>
|
|
|
|
<p className={styles.copyright}>
|
|
|
|
<small>
|
|
|
|
© {year}{' '}
|
|
|
|
<a className="u-url" href={meta.url}>
|
|
|
|
{meta.title}
|
|
|
|
</a>{' '}
|
|
|
|
— All Rights Reserved
|
|
|
|
</small>
|
|
|
|
</p>
|
|
|
|
</footer>
|
|
|
|
)
|
2019-04-16 03:59:21 +02:00
|
|
|
|
|
|
|
FooterMarkup.propTypes = {
|
|
|
|
pkg: PropTypes.object.isRequired,
|
|
|
|
meta: PropTypes.object.isRequired,
|
|
|
|
year: PropTypes.number.isRequired
|
|
|
|
}
|
|
|
|
|
2019-11-26 18:25:42 +01:00
|
|
|
function Footer() {
|
2019-11-11 21:46:14 +01:00
|
|
|
const metaYaml = useMeta()
|
|
|
|
const { portfolioJson } = useStaticQuery(query)
|
2019-11-10 13:17:13 +01:00
|
|
|
const year = new Date().getFullYear()
|
2018-06-23 17:19:45 +02:00
|
|
|
|
2019-11-10 14:40:45 +01:00
|
|
|
return <FooterMarkup year={year} pkg={portfolioJson} meta={metaYaml} />
|
2018-04-02 23:22:48 +02:00
|
|
|
}
|
2019-11-26 18:25:42 +01:00
|
|
|
|
|
|
|
export default memo(Footer)
|