Initial commit.

This commit is contained in:
CSG-Dominic
2025-03-11 13:06:14 -05:00
commit ba27084fa1
23 changed files with 2822 additions and 0 deletions

46
src/pages/index.tsx Normal file
View File

@@ -0,0 +1,46 @@
import Head from 'next/head';
import React from 'react';
import { GetServerSideProps } from 'next';
import { apiClientGet } from '@/lib/apiClient';
import { ApolloQueryResult, gql } from '@apollo/client';
import Link from 'next/link';
type PageData = {
hello:string;
}
type PageProps = ApolloQueryResult<PageData>
export const getServerSideProps:GetServerSideProps<PageProps> = async () => {
const client = await apiClientGet();
const res = await client.query<PageData>({
query: gql`
query {
hello
}
`
});
return {
props: res
};
};
const HomePage: React.FC<PageProps> = props => {
return (
<div className="homepage">
<Head>
<title>HomePlay, your personal video game library</title>
</Head>
<Link href="/game/1/play">
Play Game
</Link>
{ props.data?.hello }
</div>
);
}
export default HomePage;