* 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
This commit is contained in:
Misode
2022-01-18 01:02:19 +01:00
committed by GitHub
parent cd318dc795
commit c6c52ca41a
39 changed files with 958 additions and 373 deletions

View File

@@ -1,27 +1,25 @@
import config from '../../config.json'
import { ToolCard } from '../components'
import { locale } from '../Locales'
import { useLocale, useTitle } from '../contexts'
import { cleanUrl } from '../Utils'
type HomeProps = {
lang: string,
changeTitle: (title: string) => unknown,
interface Props {
path?: string,
}
export function Home({ lang, changeTitle }: HomeProps) {
const loc = locale.bind(null, lang)
changeTitle(loc('title.home'))
export function Home({}: Props) {
const { locale } = useLocale()
useTitle(locale('title.home'))
return <main>
<div class="home">
<ToolCard title="Data packs">
{config.generators.filter(g => !g.category).map(g =>
<ToolCard title={loc(g.id)} link={cleanUrl(g.url)} />
<ToolCard title={locale(g.id)} link={cleanUrl(g.url)} />
)}
<ToolCard title={loc('worldgen')} link="/worldgen/" />
<ToolCard title={locale('worldgen')} link="/worldgen/" />
</ToolCard>
<ToolCard title="Resource packs">
{config.generators.filter(g => g.category === 'assets').map(g =>
<ToolCard title={loc(g.id)} link={cleanUrl(g.url)} />
<ToolCard title={locale(g.id)} link={cleanUrl(g.url)} />
)}
</ToolCard>
<ToolCard title="Report Inspector" icon="report"