1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-10 20:00:09 +02:00
blog/src/components/organisms/Footer.tsx

56 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-10-02 15:32:01 +02:00
import React, { useState } from 'react'
2018-08-11 02:39:18 +02:00
import Container from '../atoms/Container'
2018-08-29 01:13:47 +02:00
import Vcard from '../molecules/Vcard'
import Subscribe from '../molecules/Subscribe'
2018-08-14 21:12:30 +02:00
import ModalThanks from '../molecules/ModalThanks'
2018-09-24 22:28:07 +02:00
import { ReactComponent as Github } from '../../images/github.svg'
import { ReactComponent as Bitcoin } from '../../images/bitcoin.svg'
2018-08-11 02:39:18 +02:00
import styles from './Footer.module.scss'
2019-10-02 15:32:01 +02:00
import { useSiteMetadata } from '../../hooks/use-site-metadata'
2018-08-11 02:39:18 +02:00
2019-10-02 15:32:01 +02:00
export default function Footer() {
const { name, uri, bitcoin, github } = useSiteMetadata()
const year = new Date().getFullYear()
const [showModal, setShowModal] = useState(false)
2018-08-11 02:39:18 +02:00
2019-10-02 15:32:01 +02:00
const toggleModal = () => {
setShowModal(!showModal)
2018-08-11 02:39:18 +02:00
}
2019-10-02 15:32:01 +02:00
return (
<footer role="contentinfo" className={styles.footer}>
<Container>
<Vcard />
<Subscribe />
<section className={styles.copyright}>
<p>
&copy; 2005&ndash;
{year + ' '}
<a href={uri} rel="me">
{name}
</a>
</p>
<p>
<a href={`${github}/blog`}>
<Github />
View source
</a>
<button className={styles.btc} onClick={toggleModal}>
<Bitcoin />
<code>{bitcoin}</code>
</button>
</p>
{showModal && (
<ModalThanks isOpen={showModal} handleCloseModal={toggleModal} />
)}
</section>
</Container>
</footer>
)
2018-08-11 02:39:18 +02:00
}