mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
remove locale code from SharePage
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
This commit is contained in:
parent
22f1b7d7c9
commit
f47e1072d9
1 changed files with 1 additions and 8 deletions
|
|
@ -5,28 +5,21 @@ import { WebsiteHeader } from '@/app/(main)/websites/[websiteId]/WebsiteHeader';
|
|||
import { WebsitePage } from '@/app/(main)/websites/[websiteId]/WebsitePage';
|
||||
import { WebsiteProvider } from '@/app/(main)/websites/WebsiteProvider';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
import { useLocale, useShareTokenQuery } from '@/components/hooks';
|
||||
import { languages } from '@/lib/lang';
|
||||
import { useShareTokenQuery } from '@/components/hooks';
|
||||
import { Footer } from './Footer';
|
||||
import { Header } from './Header';
|
||||
|
||||
export function SharePage({ shareId }) {
|
||||
const { shareToken, isLoading } = useShareTokenQuery(shareId);
|
||||
const { setTheme } = useTheme();
|
||||
const { saveLocale } = useLocale();
|
||||
|
||||
useEffect(() => {
|
||||
const url = new URL(window?.location?.href);
|
||||
const theme = url.searchParams.get('theme');
|
||||
const locale = url.searchParams.get('locale');
|
||||
|
||||
if (theme === 'light' || theme === 'dark') {
|
||||
setTheme(theme);
|
||||
}
|
||||
|
||||
if (Object.keys(languages).includes(locale)) {
|
||||
saveLocale(locale);
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (isLoading || !shareToken) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue