fix(admin): resolve hydration layout crash by removing layout-level return null and using mount-conditional text
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m5s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m5s
This commit is contained in:
@@ -33,10 +33,6 @@ export default function AdminLayout({
|
|||||||
return unsub;
|
return unsub;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!isMounted) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const verifyToken = useCallback(async (token: string): Promise<boolean> => {
|
const verifyToken = useCallback(async (token: string): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE}/api/v1/admin/verify`, {
|
const response = await fetch(`${API_BASE}/api/v1/admin/verify`, {
|
||||||
@@ -82,7 +78,9 @@ export default function AdminLayout({
|
|||||||
if (isChecking && pathname !== "/admin/login") {
|
if (isChecking && pathname !== "/admin/login") {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-card flex items-center justify-center">
|
<div className="min-h-screen bg-card flex items-center justify-center">
|
||||||
<div className="text-muted-foreground text-sm">{t('admin.layout.checking')}</div>
|
<div className="text-muted-foreground text-sm" suppressHydrationWarning>
|
||||||
|
{isMounted ? t('admin.layout.checking') : "Verifying authentication..."}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user