Skip to content

Commit

Permalink
fix: vercel deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmclin2 committed Dec 8, 2024
1 parent 39ff8f4 commit 839b5f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"remark-gfm": "^3.0.1",
"remark-html": "^16.0.1",
"resolve-accept-language": "^3.1.8",
"rtl-detect": "^1.1.2",
"serwist": "^9.0.10",
"superjson": "^2.2.1",
"swr": "^2.2.5",
Expand Down
12 changes: 10 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import { ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface';
import { cookies } from 'next/headers';
import { PropsWithChildren } from 'react';
import { isRtlLang } from 'rtl-detect';

import Analytics from '@/components/Analytics';
import NProgress from '@/components/NProgress';
import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/constants/locale';
import PWAInstall from '@/features/PWAInstall';
import Layout from '@/layout';
import { isMobileDevice } from '@/utils/server/responsive';

import StyleRegistry from './StyleRegistry';

const RootLayout = ({ children }: PropsWithChildren) => {
const RootLayout = async ({ children }: PropsWithChildren) => {
// get default theme config to use with ssr
const cookieStore = await cookies();

const lang = cookieStore.get(LOBE_LOCALE_COOKIE);
const locale = lang?.value || DEFAULT_LANG;

const direction = isRtlLang(locale) ? 'rtl' : 'ltr';
return (
<html lang="cn" suppressHydrationWarning>
<html lang={locale} dir={direction} suppressHydrationWarning>
<head>
<script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js" defer />
</head>
Expand Down

0 comments on commit 839b5f9

Please sign in to comment.