mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-14 17:36:49 +02:00
Prefetch user (#429)
This commit is contained in:
parent
37f777cace
commit
249376c43e
20 changed files with 220 additions and 181 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue