2022-04-20 21:35:07 +00:00
|
|
|
import { Nav, Navbar } from 'react-bootstrap'
|
2022-04-21 17:48:27 +00:00
|
|
|
import { getGetServerSideProps } from '../api/ssrApollo'
|
|
|
|
import Layout from '../components/layout'
|
|
|
|
import Notifications from '../components/notifications'
|
|
|
|
import { NOTIFICATIONS } from '../fragments/notifications'
|
|
|
|
import styles from '../components/header.module.css'
|
2022-04-20 21:35:07 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
|
|
|
|
export const getServerSideProps = getGetServerSideProps(NOTIFICATIONS)
|
|
|
|
|
|
|
|
export default function NotificationPage ({ data: { notifications: { notifications, cursor, lastChecked } } }) {
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Layout>
|
|
|
|
<NotificationHeader />
|
|
|
|
<Notifications
|
|
|
|
notifications={notifications} cursor={cursor}
|
2022-04-21 17:48:27 +00:00
|
|
|
lastChecked={lastChecked} variables={{ inc: router.query?.inc }}
|
2022-04-20 21:35:07 +00:00
|
|
|
/>
|
|
|
|
</Layout>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export function NotificationHeader () {
|
|
|
|
const router = useRouter()
|
|
|
|
return (
|
2022-04-21 17:48:27 +00:00
|
|
|
<Navbar className='py-0'>
|
2022-04-20 21:35:07 +00:00
|
|
|
<Nav
|
|
|
|
className={`${styles.navbarNav} justify-content-around`}
|
|
|
|
activeKey={router.asPath}
|
|
|
|
>
|
|
|
|
<Nav.Item>
|
|
|
|
<Link href='/notifications' passHref>
|
|
|
|
<Nav.Link
|
|
|
|
className={styles.navLink}
|
|
|
|
>
|
|
|
|
all
|
|
|
|
</Nav.Link>
|
|
|
|
</Link>
|
|
|
|
</Nav.Item>
|
|
|
|
<Nav.Item>
|
2022-04-21 17:48:27 +00:00
|
|
|
<Link href='/notifications?inc=replies' passHref>
|
2022-04-20 21:35:07 +00:00
|
|
|
<Nav.Link
|
|
|
|
className={styles.navLink}
|
|
|
|
>
|
|
|
|
replies
|
|
|
|
</Nav.Link>
|
|
|
|
</Link>
|
|
|
|
</Nav.Item>
|
|
|
|
</Nav>
|
|
|
|
</Navbar>
|
|
|
|
)
|
|
|
|
}
|