mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-30 17:49:34 +00:00
Improve homepage (#245)
* 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
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Ad, BtnLink, ErrorPanel, Footer, VersionDetail, VersionList } from '../components/index.js'
|
||||
import { BtnLink, ErrorPanel, Footer, VersionDetail, VersionList } from '../components/index.js'
|
||||
import { useLocale, useTitle } from '../contexts/index.js'
|
||||
import { useAsync, useSearchParam } from '../hooks/index.js'
|
||||
import type { VersionMeta } from '../services/index.js'
|
||||
@@ -9,7 +9,6 @@ interface Props {
|
||||
}
|
||||
export function Versions({}: Props) {
|
||||
const { locale } = useLocale()
|
||||
useTitle(locale('title.versions'))
|
||||
|
||||
const { value: versions, error } = useAsync(fetchVersions, [])
|
||||
|
||||
@@ -25,7 +24,6 @@ export function Versions({}: Props) {
|
||||
const previousVersion = selected && getOffsetVersion(versions ?? [], selected, 1)
|
||||
|
||||
return <main>
|
||||
<Ad type="text" id="versions" />
|
||||
{error && <ErrorPanel error={error} />}
|
||||
<div class="container">
|
||||
{selectedId ? <>
|
||||
@@ -37,7 +35,11 @@ export function Versions({}: Props) {
|
||||
icon="arrow_right" label={locale('versions.next')} swapped />
|
||||
</div>
|
||||
<VersionDetail id={selectedId} version={selected} />
|
||||
</> : <VersionList versions={versions ?? []} link={id => `/versions/?id=${id}`} />}
|
||||
</> : <>
|
||||
<VersionList versions={versions} link={id => `/versions/?id=${id}`} navigation={(
|
||||
<BtnLink link="/changelog" icon="git_commit" label={locale('versions.technical_changes')} />
|
||||
)} />
|
||||
</>}
|
||||
</div>
|
||||
<Footer donate={false} />
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user