diff --git a/src/app/edit/page.tsx b/src/app/edit/page.tsx new file mode 100644 index 000000000..4a688e5a9 --- /dev/null +++ b/src/app/edit/page.tsx @@ -0,0 +1,19 @@ +import { getChangeHistoryServerSide } from '../../js/graphql/contribAPI' +import RecentChangeHistory from '@/components/edit/RecentChangeHistory' +import { ReactElement } from 'react' +import { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Contribute to OpenBeta', + description: 'Share your climbing adventure photos and contribute to the climbing route catalog.' +} + +export default async function Page (): Promise { + const history = await getChangeHistoryServerSide() + return ( +
+

Recent history

+ +
+ ) +} diff --git a/src/pages/edit/index.tsx b/src/pages/edit/index.tsx deleted file mode 100644 index 500b9fcd9..000000000 --- a/src/pages/edit/index.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import dynamic from 'next/dynamic' -import { GetStaticProps, NextPage } from 'next' - -import SeoTags from '../../components/SeoTags' -import Layout from '../../components/layout' -import { getChangeHistoryServerSide } from '../../js/graphql/contribAPI' -import { RecentChangeHistoryProps } from '../../components/edit/RecentChangeHistory' - -interface PageProps { - history: any[] -} -const Page: NextPage = ({ history }: PageProps) => { - return ( - <> - - -
-

Recent history

- -
-
- - ) -} -export default Page - -export const getStaticProps: GetStaticProps = async ({ params }): Promise => { - const history = await getChangeHistoryServerSide() - return ({ - props: { - history - }, - revalidate: 30 // regenerate page when a request comes in but no faster than every 5s - }) -} - -const RecentChangeHistory = dynamic( - async () => - await import('../../components/edit/RecentChangeHistory').then( - module => module.default), { ssr: false } -)