mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 15:17:09 +00:00
* Improve how generators are listed on home * Add some icons for generators * Remove debug * Refactor cachedFetch and use generated changelogs * Add limit to how many changes are shown by default * Add more generator icons * Refactor cards * Fix generator icons for light theme * Add more worldgen icons * Add remaining generator icons * Refactor navigation and badges style * Group on homepage for guides and tools * Fix header button style * Add versions and technical changelog to homepage * Make it clear that not all changes could be documented
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import type { RouterOnChangeArgs } from 'preact-router'
|
|
import { Router } from 'preact-router'
|
|
import '../styles/global.css'
|
|
import '../styles/nodes.css'
|
|
import { Analytics } from './Analytics.js'
|
|
import { Header } from './components/index.js'
|
|
import { Changelog, Generator, Generators, Guide, Guides, Home, Partners, Sounds, Versions, Worldgen } from './pages/index.js'
|
|
import { cleanUrl } from './Utils.js'
|
|
|
|
export function App() {
|
|
const changeRoute = (e: RouterOnChangeArgs) => {
|
|
window.dispatchEvent(new CustomEvent('replacestate'))
|
|
// Needs a timeout to ensure the title is set correctly
|
|
setTimeout(() => Analytics.pageview(cleanUrl(e.url)))
|
|
}
|
|
|
|
return <>
|
|
<Header />
|
|
<Router onChange={changeRoute}>
|
|
<Home path="/" />
|
|
<Generators path="/generators" />
|
|
<Worldgen path="/worldgen" />
|
|
<Partners path="/partners" />
|
|
<Sounds path="/sounds" />
|
|
<Changelog path="/changelog" />
|
|
<Versions path="/versions" />
|
|
<Guides path="/guides" />
|
|
<Guide path="/guides/:id" />
|
|
<Generator default />
|
|
</Router>
|
|
</>
|
|
}
|