mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 11:59:11 +00:00
remove next providers
This commit is contained in:
parent
d822fee527
commit
c477f63b56
1 changed files with 0 additions and 27 deletions
|
@ -1,27 +0,0 @@
|
|||
import { AppShellProps } from '@roleypoly/design-system/organisms/app-shell';
|
||||
import { NextPageContext } from 'next';
|
||||
import { SessionData } from 'roleypoly/common/types';
|
||||
import { swrFetch } from 'roleypoly/common/utils/isomorphicFetch';
|
||||
|
||||
export type ProvidableAppShellProps = {
|
||||
user: AppShellProps['user'];
|
||||
guilds: AppShellProps['guilds'];
|
||||
};
|
||||
|
||||
export const useAppShellProps = (context?: NextPageContext) => {
|
||||
const { data, error } = swrFetch<Omit<SessionData, 'tokens'>>(
|
||||
'/get-session',
|
||||
context
|
||||
);
|
||||
|
||||
const props: ProvidableAppShellProps = {
|
||||
user: data?.user,
|
||||
guilds: data?.guilds,
|
||||
};
|
||||
|
||||
return {
|
||||
appShellProps: props,
|
||||
isLoading: !error && !data,
|
||||
isError: error,
|
||||
};
|
||||
};
|
Loading…
Add table
Reference in a new issue