diff --git a/src/app/components/Giscus.tsx b/src/app/components/Giscus.tsx
index cfc758d7..74bcf01e 100644
--- a/src/app/components/Giscus.tsx
+++ b/src/app/components/Giscus.tsx
@@ -11,16 +11,18 @@ export function Giscus({ term }: Props) {
? `http://localhost:3000/src/styles/giscus${themeSuffix}.css`
: `${location.protocol}//${location.host}/assets/giscus${themeSuffix}.css`
- return
+ return
}
-
-function ArticleLink({ id, article }: ChangelogVersion) {
- return article === null
- ?
{id}
- :
{id}
-}
diff --git a/src/app/components/versions/VersionDetail.tsx b/src/app/components/versions/VersionDetail.tsx
index 0a275ec3..94d91ce8 100644
--- a/src/app/components/versions/VersionDetail.tsx
+++ b/src/app/components/versions/VersionDetail.tsx
@@ -2,16 +2,18 @@ import { useEffect, useMemo, useState } from 'preact/hooks'
import { VersionMetaData } from '.'
import { useLocale } from '../../contexts'
import type { Change, VersionMeta } from '../../services'
-import { getChangelogs } from '../../services'
+import { getArticleLink, getChangelogs } from '../../services'
import { Giscus } from '../Giscus'
+import { Octicon } from '../Octicon'
import { ChangelogList } from './ChangelogList'
type Tab = 'changelog' | 'discussion'
interface Props {
- version: VersionMeta
+ id: string,
+ version?: VersionMeta,
}
-export function VersionDetail({ version }: Props) {
+export function VersionDetail({ id, version }: Props) {
const { locale } = useLocale()
const [tab, setTab] = useState
('changelog')
@@ -20,33 +22,45 @@ export function VersionDetail({ version }: Props) {
useEffect(() => {
getChangelogs()
.then(changelogs => setChangelogs(
- changelogs.map(c => ({ ...c, tags: c.tags.filter(t => t !== c.group.id) }))
+ changelogs.map(c => ({ ...c, tags: c.tags.filter(t => t !== c.group) }))
))
.catch(e => console.error(e))
}, [])
const filteredChangelogs = useMemo(() =>
- changelogs?.filter(c => c.version.id === version.id || c.group.id === version.id),
- [version.id, changelogs])
+ changelogs?.filter(c => c.version === id || c.group === id),
+ [id, changelogs])
+
+ const articleLink = version && getArticleLink(version.id)
return <>
-
{version.name}
+
{version?.name ?? id}
-
-
-
-
-
-
+ {version ? <>
+
+
+
+
+
+
+ > : filteredChangelogs?.length ?? 0 > 1 ?
+ This version is not released yet.
+
:
+ This version does not exist. Only versions since 1.14 are tracked, or it may be too recent.
+
}
{tab === 'changelog' && }
- {tab === 'discussion' && }
+ {tab === 'discussion' && }
>
diff --git a/src/app/pages/Versions.tsx b/src/app/pages/Versions.tsx
index 203dd96e..7711efee 100644
--- a/src/app/pages/Versions.tsx
+++ b/src/app/pages/Versions.tsx
@@ -43,13 +43,7 @@ export function Versions({}: Props) {
{Octicon.arrow_right}
- {selected ?