mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-25 08:06:51 +00:00
Use masonry layout for homepage
This commit is contained in:
@@ -5,10 +5,11 @@ import { Badge } from './index.js'
|
||||
|
||||
interface Props {
|
||||
id: string,
|
||||
minimal?: boolean,
|
||||
activeTags?: string[],
|
||||
toggleTag?: (tag: string) => unknown,
|
||||
}
|
||||
export function GuideCard({ id, activeTags, toggleTag }: Props) {
|
||||
export function GuideCard({ id, minimal, activeTags, toggleTag }: Props) {
|
||||
const { title, versions, tags } = useMemo(() => getGuide(id), [id])
|
||||
|
||||
const onToggleTag = (tag: string) => (e: MouseEvent) => {
|
||||
@@ -17,7 +18,7 @@ export function GuideCard({ id, activeTags, toggleTag }: Props) {
|
||||
e.stopImmediatePropagation()
|
||||
}
|
||||
|
||||
return <Card title={title} overlay={versions?.join(' • ')} link={`/guides/${id}/`}>
|
||||
return <Card title={title} overlay={!minimal && versions?.join(' • ')} link={`/guides/${id}/`}>
|
||||
<div class="badges-list">
|
||||
{tags?.sort().map(tag => <Badge label={tag} onClick={onToggleTag(tag)} active={activeTags?.includes(tag)} />)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user