-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.tsx
More file actions
41 lines (35 loc) · 1.07 KB
/
index.tsx
File metadata and controls
41 lines (35 loc) · 1.07 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import {Hero} from "@/components/Hero";
import {ExtendedStory} from "@prezly/sdk/dist/types/Story";
import {ArticleListHorizontal} from "@/components/ArticleList";
import Page from "@/components/Layout/Page";
import {getPrezlyApi} from "utils/prezly";
type HomePageProps = {
stories: Array<ExtendedStory>;
};
export default class HomePage extends React.Component<HomePageProps> {
render() {
const {stories} = this.props;
const meta = {
title: 'Lifelog.be',
description: 'On this page I write about running a company and other things related to the web.'
}
return (
<>
<Page meta={meta}>
<Hero />
<ArticleListHorizontal stories={stories} />
</Page>
</>
);
}
}
export async function getStaticProps({ params, preview }) {
const api = getPrezlyApi();
const stories = await api.getStoriesExtended({ pageSize: 3 });
return {
props: {
stories,
},
};
}