Prefetch user (#429)

This commit is contained in:
Luke Vella 2023-01-23 14:19:17 +00:00 committed by GitHub
parent 37f777cace
commit 249376c43e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 220 additions and 181 deletions

View file

@ -18,9 +18,9 @@ import {
UserDetailsData,
UserDetailsForm,
} from "./forms";
import { SessionProps, useSession, withSession } from "./session";
import StandardLayout from "./standard-layout";
import Steps from "./steps";
import { useUser } from "./user-provider";
type StepName = "eventDetails" | "options" | "userDetails";
@ -37,7 +37,7 @@ const required = <T,>(v: T | undefined): T => {
const initialNewEventData: NewEventData = { currentStep: 0 };
const sessionStorageKey = "newEventFormData";
export interface CreatePollPageProps extends SessionProps {
export interface CreatePollPageProps {
title?: string;
location?: string;
description?: string;
@ -54,7 +54,7 @@ const Page: NextPage<CreatePollPageProps> = ({
const router = useRouter();
const session = useSession();
const session = useUser();
const [persistedFormData, setPersistedFormData] =
useSessionStorage<NewEventData>(sessionStorageKey, {
@ -228,4 +228,4 @@ const Page: NextPage<CreatePollPageProps> = ({
);
};
export default withSession(Page);
export default Page;