mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +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
801 B
TypeScript
33 lines
801 B
TypeScript
import { Icons } from './Icons.js'
|
|
import { Octicon } from './Octicon.jsx'
|
|
|
|
interface Props {
|
|
title: string,
|
|
titleIcon?: keyof typeof Octicon | keyof typeof Icons,
|
|
link: string,
|
|
icon?: keyof typeof Icons,
|
|
desc?: string,
|
|
}
|
|
export function ToolCard({ title, desc, link, icon, titleIcon }: Props) {
|
|
if (icon || desc) {
|
|
return <a class="tool-card" href={link}>
|
|
{icon && Icons[icon]}
|
|
<div>
|
|
<ToolHead title={title} titleIcon={titleIcon} />
|
|
<p>{desc}</p>
|
|
</div>
|
|
</a>
|
|
}
|
|
|
|
return <a class="tool-card" href={link}>
|
|
<ToolHead title={title} titleIcon={titleIcon} />
|
|
</a>
|
|
}
|
|
|
|
function ToolHead({ title, titleIcon }: Pick<Props, 'title' | 'titleIcon'>) {
|
|
return <h3>
|
|
{title}
|
|
{titleIcon && (titleIcon in Octicon ? (Octicon as any)[titleIcon] : (Icons as any)[titleIcon])}
|
|
</h3>
|
|
}
|