diff --git a/app/(root)/backstage/layout.tsx b/app/(root)/backstage/layout.tsx index a21c1fa..6972813 100644 --- a/app/(root)/backstage/layout.tsx +++ b/app/(root)/backstage/layout.tsx @@ -1,13 +1,14 @@ 'use client'; import React, { useEffect, useState } from 'react'; +import { Center, Text } from '@mantine/core'; import Watermark from '@/app/(root)/backstage/components/Watermark'; import { Cookie } from '@/components/cookie'; import Tools from '@/app/(root)/backstage/components/Tools'; export default function BackStageLayout({ children }: { children: React.ReactNode }) { - const [userName, setUserName] = useState(''); - const [userId, setUserId] = useState(''); + const [userName, setUserName] = useState(null); + const [userId, setUserId] = useState(null); useEffect(() => { if (typeof window !== 'undefined') { @@ -19,16 +20,26 @@ export default function BackStageLayout({ children }: { children: React.ReactNod } }, []); + if (userName === null || userId === null) { + return ( +
+ + Loading... + +
+ ); + } + return ( -
- + + <> {children} - -
+ + ); }