mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
37 lines
793 B
JavaScript
37 lines
793 B
JavaScript
|
|
import styled from 'styled-components';
|
||
|
|
import Head from 'next/head';
|
||
|
|
import useUser from '../lib/useUser';
|
||
|
|
import HomeContent from '../components/HomeContent';
|
||
|
|
import connectDb from '../utils/db';
|
||
|
|
import Login from '../components/Login';
|
||
|
|
import Layout from '../components/Layout';
|
||
|
|
|
||
|
|
const LandingStyles = styled.div`
|
||
|
|
display: grid;
|
||
|
|
`;
|
||
|
|
|
||
|
|
export default function Home() {
|
||
|
|
const { user, mutateUser } = useUser();
|
||
|
|
|
||
|
|
if (!user) {
|
||
|
|
return (
|
||
|
|
<Layout>
|
||
|
|
<h1>Loading...</h1>
|
||
|
|
</Layout>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
return (
|
||
|
|
<LandingStyles>
|
||
|
|
<Head>
|
||
|
|
<title key="title">N & N | Wedding</title>
|
||
|
|
</Head>
|
||
|
|
{user && user.isLoggedIn === true ? <HomeContent /> : <Login />}
|
||
|
|
</LandingStyles>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function getServerSideProps() {
|
||
|
|
return { props: {} };
|
||
|
|
}
|