mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
* Add file save UI and drafts project * Fix build * Create SearchList component as abstraction * Add project page and file tree view * Create Locale context * Create Theme context * Create Version context * Create Title context * Create Project context * Store current file in project context * Fix issues when renaming file and implement deleting * Style improvements * Make all project strings translatable * Fix z-index
29 lines
860 B
TypeScript
29 lines
860 B
TypeScript
import type { RouterOnChangeArgs } from 'preact-router'
|
|
import { Router } from 'preact-router'
|
|
import '../styles/global.css'
|
|
import '../styles/nodes.css'
|
|
import { Analytics } from './Analytics'
|
|
import { Header } from './components'
|
|
import { Category, Changelog, Generator, Home, Project, Sounds } from './pages'
|
|
import { cleanUrl } from './Utils'
|
|
|
|
export function App() {
|
|
const changeRoute = (e: RouterOnChangeArgs) => {
|
|
// Needs a timeout to ensure the title is set correctly
|
|
setTimeout(() => Analytics.pageview(cleanUrl(e.url)))
|
|
}
|
|
|
|
return <>
|
|
<Header />
|
|
<Router onChange={changeRoute}>
|
|
<Home path="/" />
|
|
<Category path="/worldgen" category="worldgen" />
|
|
<Category path="/assets" category="assets" />
|
|
<Sounds path="/sounds" />
|
|
<Changelog path="/changelog" />
|
|
<Project path="/project" />
|
|
<Generator default />
|
|
</Router>
|
|
</>
|
|
}
|