mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	Revert "fix(website): missing suspense"
This reverts commit dbfa94a9ee45a7fef43cd97c90df35f85d7bad34.
This commit is contained in:
		
							parent
							
								
									dbfa94a9ee
								
							
						
					
					
						commit
						d5ce01a65b
					
				@ -11,7 +11,6 @@ import menuIcon from "../assets/boxicons/bx-menu.svg?raw";
 | 
			
		||||
import { LocaleContext } from "..";
 | 
			
		||||
import { useTranslation } from "react-i18next";
 | 
			
		||||
import { swapLocaleInUrl } from "../i18n";
 | 
			
		||||
import { Suspense } from "preact/compat";
 | 
			
		||||
 | 
			
		||||
interface HeaderLink {
 | 
			
		||||
    url: string;
 | 
			
		||||
@ -79,9 +78,7 @@ export function Header(props: {repoStargazersCount: number}) {
 | 
			
		||||
                    />
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <Suspense fallback={<div class="loading-screen">Loading...</div>}>
 | 
			
		||||
                    <DownloadButton />
 | 
			
		||||
                </Suspense>
 | 
			
		||||
                <DownloadButton />
 | 
			
		||||
 | 
			
		||||
            </div>
 | 
			
		||||
		</header>
 | 
			
		||||
 | 
			
		||||
@ -13,33 +13,30 @@ 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>
 | 
			
		||||
                    <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} />
 | 
			
		||||
		<LocationProvider>
 | 
			
		||||
            <LocaleProvider>
 | 
			
		||||
                <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 />
 | 
			
		||||
                    </Suspense>
 | 
			
		||||
                </LocaleProvider>
 | 
			
		||||
            </LocationProvider>
 | 
			
		||||
                        <Route default component={NotFound} />
 | 
			
		||||
                    </Router>
 | 
			
		||||
                </main>
 | 
			
		||||
                <Footer />
 | 
			
		||||
            </LocaleProvider>
 | 
			
		||||
		</LocationProvider>
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -33,7 +33,6 @@ import presentationIcon from "../../assets/boxicons/bx-slideshow.svg?raw";
 | 
			
		||||
import { getPlatform } from '../../download-helper.js';
 | 
			
		||||
import { useEffect, useState } from 'preact/hooks';
 | 
			
		||||
import { Trans, useTranslation } from 'react-i18next';
 | 
			
		||||
import { Suspense } from 'preact/compat';
 | 
			
		||||
 | 
			
		||||
export function Home() {
 | 
			
		||||
    usePageTitle("");
 | 
			
		||||
@ -80,9 +79,7 @@ function HeroSection() {
 | 
			
		||||
                <p>{t("hero_section.subtitle")}</p>
 | 
			
		||||
 | 
			
		||||
                <div className="download-wrapper">
 | 
			
		||||
                    <Suspense fallback={<div class="loading-screen">Loading...</div>}>
 | 
			
		||||
                        <DownloadButton big />
 | 
			
		||||
                    </Suspense>
 | 
			
		||||
                    <DownloadButton big />
 | 
			
		||||
                    <Button href="./get-started/" className="mobile-only" text={t("hero_section.get_started")} />
 | 
			
		||||
                    <div className="additional-options">
 | 
			
		||||
                        <Button iconSvg={gitHubIcon} outline text={t("hero_section.github")} href="https://github.com/TriliumNext/Trilium/" openExternally />
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user