mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
Add a wiki page button to versions (#470)
* Add a wiki page button to versions * Wrap tabs and change tab to "Wiki" --------- Co-authored-by: Misode <misoloo64@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import { Octicon } from '../Octicon.js'
|
||||
import { ChangelogList, IssueList, VersionDiff, VersionMetaData } from './index.js'
|
||||
|
||||
const Tabs = ['changelog', 'diff', 'fixes']
|
||||
const WIKI_PAGE_PREFIX = 'https://minecraft.wiki/w/Java_Edition_'
|
||||
|
||||
interface Props {
|
||||
id: string,
|
||||
@@ -31,6 +32,7 @@ export function VersionDetail({ id, version }: Props) {
|
||||
[id, changes])
|
||||
|
||||
const articleLink = version && getArticleLink(version.id)
|
||||
const wikiPageLink = version && WIKI_PAGE_PREFIX + version.name
|
||||
|
||||
return <>
|
||||
<div class="version-detail">
|
||||
@@ -57,6 +59,10 @@ export function VersionDetail({ id, version }: Props) {
|
||||
{locale('versions.article')}
|
||||
{Octicon.link_external}
|
||||
</a>}
|
||||
{wikiPageLink && <a href={wikiPageLink} target="_blank">
|
||||
{locale('versions.wiki')}
|
||||
{Octicon.link_external}
|
||||
</a>}
|
||||
</div>
|
||||
<div class="version-tab">
|
||||
{tab === 'changelog' && <ChangelogList changes={filteredChangelogs} defaultOrder="asc" />}
|
||||
|
||||
Reference in New Issue
Block a user