stacker.news/pages/~/[sub]/recent.js

20 lines
616 B
JavaScript
Raw Normal View History

2022-02-17 17:23:43 +00:00
import { getGetServerSideProps } from '../../../api/ssrApollo'
import Items from '../../../components/items'
import Layout from '../../../components/layout'
import { SUB_ITEMS } from '../../../fragments/subs'
const variables = { sort: 'recent' }
2022-03-03 22:18:16 +00:00
export const getServerSideProps = getGetServerSideProps(SUB_ITEMS, variables, 'sub')
2022-02-17 17:23:43 +00:00
// need to recent list items
export default function Sub ({ data: { sub: { name }, items: { items, cursor } } }) {
return (
<Layout sub={name}>
<Items
items={items} cursor={cursor}
variables={{ sub: name, ...variables }} rank
/>
</Layout>
)
}