mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
20 lines
579 B
TypeScript
20 lines
579 B
TypeScript
import { useRouter } from 'next/router';
|
|
import * as React from 'react';
|
|
import { LandingTemplate } from 'roleypoly/design-system/templates/landing';
|
|
import { useAppShellProps } from 'roleypoly/providers/appShellData';
|
|
|
|
const Index = () => {
|
|
const {
|
|
appShellProps: { guilds, user },
|
|
} = useAppShellProps();
|
|
const router = useRouter();
|
|
|
|
React.useEffect(() => {
|
|
if (user || guilds) {
|
|
void router.replace('/servers');
|
|
}
|
|
}, [guilds, user]);
|
|
|
|
return <LandingTemplate user={user} guilds={guilds} />;
|
|
};
|
|
export default Index;
|