stacker.news/components/footer.js

99 lines
3.2 KiB
JavaScript
Raw Normal View History

2021-06-02 23:15:28 +00:00
import { useQuery } from '@apollo/client'
import gql from 'graphql-tag'
2021-09-02 23:27:11 +00:00
import { Container, OverlayTrigger, Popover } from 'react-bootstrap'
2021-06-02 23:15:28 +00:00
import { CopyInput } from './form'
2021-06-04 01:55:23 +00:00
import styles from './footer.module.css'
2021-06-30 23:01:28 +00:00
import Texas from '../svgs/texas.svg'
import Github from '../svgs/github-fill.svg'
import Twitter from '../svgs/twitter-fill.svg'
2021-07-15 23:06:21 +00:00
import Link from 'next/link'
2021-06-02 23:15:28 +00:00
2021-09-02 23:27:11 +00:00
const ChatPopover = (
<Popover>
<Popover.Content style={{ fontWeight: 500, opacity: 0.5, fontSize: '.9rem' }}>
<a
href='https://tribes.sphinx.chat/t/stackerzchat' className='text-reset d-inline-flex'
target='_blank' rel='noreferrer'
>
sphinx
</a>
<span className='mx-2'> \ </span>
<a
href='https://t.me/stackernews' className='text-reset d-inline-flex'
target='_blank' rel='noreferrer'
>
telegram
</a>
</Popover.Content>
</Popover>
)
2021-08-26 21:22:37 +00:00
export default function Footer ({ noLinks }) {
2021-06-02 23:15:28 +00:00
const query = gql`
{
connectAddress
}
`
const { data } = useQuery(query)
return (
<footer>
2021-08-26 21:22:37 +00:00
<Container className='mb-3 mt-4'>
{!noLinks &&
<div className='mb-2' style={{ fontWeight: 500, opacity: 0.5 }}>
<Link href='/faq' passHref>
<a className='text-reset d-inline-flex'>
faq
</a>
</Link>
<span className='mx-2'> \ </span>
2021-09-02 17:49:17 +00:00
<Link href='/story' passHref>
<a className='text-reset d-inline-flex'>
story
</a>
</Link>
2021-08-26 21:22:37 +00:00
<span className='mx-2'> \ </span>
2021-09-02 19:47:17 +00:00
<a
href='https://plausible.io/stacker.news' className='text-reset d-inline-flex'
target='_blank' rel='noreferrer'
>
2021-08-26 21:22:37 +00:00
analytics
</a>
2021-09-02 17:49:17 +00:00
<span className='mx-2'> \ </span>
2021-09-02 23:27:11 +00:00
<OverlayTrigger trigger='click' placement='top' overlay={ChatPopover} rootClose>
<div className='text-reset d-inline-flex' style={{ cursor: 'pointer' }}>
chat
</div>
</OverlayTrigger>
2021-09-02 19:47:17 +00:00
<span className='mx-2'> \ </span>
2021-09-02 17:49:17 +00:00
<a href='/rss' className='text-reset d-inline-flex' target='_blank'>
rss
</a>
2021-08-26 21:22:37 +00:00
</div>}
2021-06-30 23:01:28 +00:00
{data &&
2021-06-02 23:31:07 +00:00
<div
2021-06-30 23:01:28 +00:00
className={`text-small mx-auto mb-2 ${styles.connect}`}
2021-06-02 23:31:07 +00:00
>
2021-06-02 23:15:28 +00:00
<span className='nav-item text-muted mr-2'>connect:</span>
<CopyInput
size='sm'
2021-06-02 23:31:07 +00:00
groupClassName='mb-0 w-100'
2021-06-02 23:15:28 +00:00
readOnly
placeholder={data.connectAddress}
/>
2021-06-30 23:01:28 +00:00
</div>}
<small>
2021-09-23 17:42:00 +00:00
<a className='text-dark d-inline-block' href='https://github.com/stackernews/stacker.news'>
This is free open source software<Github width={20} height={20} className='mx-1' />
2021-06-30 23:01:28 +00:00
</a>
2021-09-23 17:42:00 +00:00
<span className='d-inline-block text-muted'>
made with sound love in Austin<Texas className='mx-1' width={20} height={20} />
by<a href='https://twitter.com/k00bideh' className='text-twitter d-inline-block'><Twitter width={20} height={20} className='ml-1' />@k00bideh</a>
2021-06-30 23:01:28 +00:00
</span>
</small>
</Container>
2021-06-02 23:15:28 +00:00
</footer>
)
}