Skip to content

Commit

Permalink
Merge pull request #10722 from Swekka/beatmapset-status-wiki-link
Browse files Browse the repository at this point in the history
Make beatmapset status label on beatmapset page link to wiki
  • Loading branch information
nanaya authored Dec 20, 2023
2 parents 9c6df76 + fe17f23 commit c5e8a06
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions resources/js/beatmapsets-show/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,23 @@ export default class Header extends React.Component<Props> {
<span className='fas fa-image' />
</div>
}
<div className='beatmapset-status beatmapset-status--show'>
<a className='beatmapset-status beatmapset-status--show' href={this.statusToWikiLink(this.controller.currentBeatmap.status)}>
{trans(`beatmapsets.show.status.${this.controller.currentBeatmap.status}`)}
</div>
</a>
</div>
);
}

private statusToWikiLink(status: string): string {
let fragment: string;
if (status === 'wip' || status === 'pending') {
fragment = 'wip-and-pending';
} else {
fragment = status;
}
return wikiUrl(`Beatmap/Category#${fragment}`);
}

private readonly updateFavouritePopup = () => {
if (!this.hoveredFavouriteIcon) {
return;
Expand Down

0 comments on commit c5e8a06

Please sign in to comment.