fix(website): missing suspense

This commit is contained in:
Elian Doran
2025-10-27 16:35:26 +02:00
parent 86aaa97809
commit dbfa94a9ee
3 changed files with 28 additions and 19 deletions

View File

@@ -13,30 +13,33 @@ import { default as i18next, changeLanguage } from 'i18next';
import { extractLocaleFromUrl, LOCALES, mapLocale } from './i18n';
import HttpApi from 'i18next-http-backend';
import { initReactI18next } from "react-i18next";
import { Suspense } from 'preact/compat';
export const LocaleContext = createContext('en');
export function App(props: {repoStargazersCount: number}) {
return (
<LocationProvider>
<LocaleProvider>
<Header repoStargazersCount={props.repoStargazersCount} />
<main>
<Router>
<Route path="/" component={Home} />
<Route path="/get-started" component={GetStarted} />
<Route path="/support-us" component={SupportUs} />
<LocationProvider>
<LocaleProvider>
<Suspense fallback={<div class="loading-screen">Loading...</div>}>
<Header repoStargazersCount={props.repoStargazersCount} />
<main>
<Router>
<Route path="/" component={Home} />
<Route path="/get-started" component={GetStarted} />
<Route path="/support-us" component={SupportUs} />
<Route path="/:locale:/" component={Home} />
<Route path="/:locale:/get-started" component={GetStarted} />
<Route path="/:locale:/support-us" component={SupportUs} />
<Route path="/:locale:/" component={Home} />
<Route path="/:locale:/get-started" component={GetStarted} />
<Route path="/:locale:/support-us" component={SupportUs} />
<Route default component={NotFound} />
</Router>
</main>
<Footer />
</LocaleProvider>
</LocationProvider>
<Route default component={NotFound} />
</Router>
</main>
<Footer />
</Suspense>
</LocaleProvider>
</LocationProvider>
);
}