forked from clintonwoo/hackernews-react-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththreads.tsx
29 lines (23 loc) · 764 Bytes
/
threads.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import * as React from 'react';
import { NewsFeedView } from '../src/components/news-feed';
import { sampleData } from '../src/data/sample-data';
import { withDataAndRouter } from '../src/helpers/with-data';
import { MainLayout } from '../src/layouts/main-layout';
export interface IThreadsPageProps {
router;
}
export function ThreadsPage(props: IThreadsPageProps): JSX.Element {
const { router } = props;
const pageNumber = (router.query && +router.query.p) || 0;
return (
<MainLayout currentUrl={router.pathname}>
<NewsFeedView
currentUrl={router.pathname}
first={30}
newsItems={sampleData.newsItems}
skip={pageNumber * 30}
/>
</MainLayout>
);
}
export default withDataAndRouter(ThreadsPage);