mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-02-11 22:45:04 -05:00
* upgraded storybook dependencies * upgraded web dependencies * updated timezone selector * upgrade chakra in metamaps * upgraded react-dnd in metamaps * upgraded framer-motion * fixed types in metamaps * upgraded eslint * upgraded lerna, husky and graphql * upgraded node version * removed metamaps package * fixed all eslint issues * ran yarn format to prettier format all files * updated lint-staged & husky scripts * add executable perms to pre-push scripts * updated yarn.lock * fixed eslint and moved chakra icons to ds * fixed emotion errors * removed extra useContext * update yarn.lock * upgraded more packages * removed unnecessary .huskyrc.json * lint fix
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { SetupAvailability } from 'components/Setup/SetupAvailability';
|
|
import { SetupProfile } from 'components/Setup/SetupProfile';
|
|
import { SetupContextProvider } from 'contexts/SetupContext';
|
|
import { useUser } from 'lib/hooks';
|
|
import { InferGetStaticPropsType } from 'next';
|
|
import React, { useState } from 'react';
|
|
|
|
export const getStaticProps = async () => ({
|
|
props: {
|
|
hideAppDrawer: true,
|
|
},
|
|
});
|
|
|
|
export type DefaultSetupProps = InferGetStaticPropsType<typeof getStaticProps>;
|
|
|
|
const AvailabilitySetup: React.FC<DefaultSetupProps> = () => {
|
|
const [availability, setAvailability] = useState<string>('');
|
|
const { user } = useUser({ redirectTo: '/' });
|
|
|
|
if (user?.player) {
|
|
const { player } = user;
|
|
if (player.availability_hours && !availability) {
|
|
setAvailability(player.availability_hours.toString());
|
|
}
|
|
}
|
|
|
|
return (
|
|
<SetupContextProvider>
|
|
<SetupProfile>
|
|
<SetupAvailability
|
|
availability={availability}
|
|
setAvailability={setAvailability}
|
|
/>
|
|
</SetupProfile>
|
|
</SetupContextProvider>
|
|
);
|
|
};
|
|
export default AvailabilitySetup;
|