mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 15:47:08 +00:00
Hide changelog versions on medium screen
This commit is contained in:
@@ -5,11 +5,12 @@ import { Badge } from './index.js'
|
||||
|
||||
type Props = {
|
||||
change: Change,
|
||||
minimal?: boolean,
|
||||
activeTags?: string[],
|
||||
toggleTag?: (tag: string) => unknown,
|
||||
}
|
||||
export function ChangelogEntry({ change, activeTags, toggleTag }: Props) {
|
||||
return <Card overlay={<>
|
||||
export function ChangelogEntry({ change, minimal, activeTags, toggleTag }: Props) {
|
||||
return <Card overlay={!minimal && <>
|
||||
<a class="changelog-version" href={`/versions/?id=${change.version}`}>{change.version}</a>
|
||||
<a class="changelog-version" href={`/versions/?id=${change.group}`}>{change.group}</a>
|
||||
</>}>
|
||||
|
||||
@@ -116,10 +116,12 @@ function Versions() {
|
||||
function Changelog() {
|
||||
const { locale } = useLocale()
|
||||
|
||||
const hugeScreen = useMediaQuery('(min-width: 960px)')
|
||||
|
||||
const { value: changes } = useAsync(fetchChangelogs, [])
|
||||
const latestChanges = useMemo(() => changes?.sort((a, b) => b.order - a.order).slice(0, 2), [changes])
|
||||
|
||||
return <ToolGroup title={locale('changelog')} link="/changelog/" titleIcon="git_commit">
|
||||
{latestChanges?.map(change => <ChangelogEntry change={change} />)}
|
||||
{latestChanges?.map(change => <ChangelogEntry minimal={!hugeScreen} change={change} />)}
|
||||
</ToolGroup>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user