Full refactor to Typescript

This commit is contained in:
2022-11-17 19:19:33 +01:00
parent de3f10b3ee
commit ffd3c99292
19 changed files with 180 additions and 95 deletions
+26 -7
View File
@@ -8,7 +8,7 @@ import { LoginPage } from './pages/Login'
import { ProblemPage } from './pages/Problem'
import { ProfilePage } from './pages/Profile'
const Redirect = ({ to }: { default: boolean; to: string }) => {
const Redirect = ({ to }: { to: string }) => {
useEffect(() => {
route(to, true)
}, [])
@@ -23,12 +23,31 @@ const Redirect = ({ to }: { default: boolean; to: string }) => {
export const App = ({ url }: { url?: string }) => {
return (
<Router url={url}>
<HomePage path="/" />
<LoginPage path="/login" />
<ProfilePage path="/profile" />
<ProblemPage path="/problem/:id" />
<AdminPage path="/admin" />
<Redirect default to="/" />
<HomePage
// @ts-ignore
path="/"
/>
<LoginPage
// @ts-ignore
path="/login"
/>
<ProfilePage
// @ts-ignore
path="/profile"
/>
<ProblemPage
// @ts-ignore
path="/problem/:id"
/>
<AdminPage
// @ts-ignore
path="/admin"
/>
<Redirect
// @ts-ignore
default
to="/"
/>
</Router>
)
}