Skip to content

Commit

Permalink
Fix routing... It's not over yet..
Browse files Browse the repository at this point in the history
  • Loading branch information
EtherCD committed Aug 19, 2024
1 parent c73a117 commit 41783c2
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { render } from 'preact';
import { Switch, Route } from 'wouter-preact';
import { render } from "preact";
import { Switch, Route } from "wouter-preact";
import { Suspense } from "preact/compat";

import { Home } from './pages/Home';
import { NotFound } from './pages/NotFound';
import { Login } from './pages/Auth/Login';
import { Logout } from './pages/Auth/Logout';
import { Home } from "./pages/Home";
import { NotFound } from "./pages/NotFound";
import { Login } from "./pages/Auth/Login";
import { Logout } from "./pages/Auth/Logout";

import "./styles/reset.css";
import "./styles/font.css";
Expand All @@ -14,24 +14,22 @@ import styles from "./styles/index.module.css";

export function App() {
return (
<Switch>
<Suspense fallback={
<div className={styles.wrapper}>
<img
className={styles.logo}
src={'/images/meta/favicon.svg'}
alt={'Логотип Pixel Battle'}
/>
<p className={styles.message}>Loading</p>
</div>
}>
<Route path="/" component={Home} />
</Suspense>
<Route path="/login" component={Login} />
<Route path="/logout" component={Logout} />
<Route path={undefined} component={NotFound} />
</Switch>
<Suspense
fallback={
<div className={styles.wrapper}>
<img className={styles.logo} src={"/images/meta/favicon.svg"} alt={"Логотип Pixel Battle"} />
<p className={styles.message}>Загрузка</p>
</div>
}
>
<Switch>
<Route path="/" component={Home} />
<Route path="/login" component={Login} />
<Route path="/logout" component={Logout} />
<Route path={undefined} component={NotFound} />
</Switch>
</Suspense>
);
}

render(<App />, document.getElementById('app') as HTMLElement);
render(<App />, document.getElementById("app") as HTMLElement);

0 comments on commit 41783c2

Please sign in to comment.