fix mapper link for song to
All checks were successful
Deploy Website / deploy (push) Successful in 5m3s

This commit is contained in:
Lee 2024-10-13 00:37:16 +01:00
parent 783da27b1e
commit b7783f5a4d
2 changed files with 16 additions and 7 deletions

View File

@ -1,4 +1,5 @@
import NextLink from "next/link";
import { clsx } from "clsx";
type Props = {
/**
@ -6,15 +7,20 @@ type Props = {
*/
href?: string;
/**
* The class name to apply to the link.
*/
className?: string;
/**
* The children to render.
*/
children: React.ReactNode;
};
export default function FallbackLink({ href, children }: Props) {
export default function FallbackLink({ href, children, className }: Props) {
return href ? (
<NextLink href={href} target="_blank" className="w-fit">
<NextLink href={href} target="_blank" className={clsx("w-fit", className)}>
{children}
</NextLink>
) : (

View File

@ -70,12 +70,15 @@ export default function ScoreSongInfo({ leaderboard, beatSaverMap }: Props) {
>
{leaderboard.songName} {leaderboard.songSubName}
</Link>
<p className="text-sm text-gray-400">{leaderboard.songAuthorName}</p>
<FallbackLink href={mappersProfile}>
<p className={clsx("text-sm", mappersProfile && "hover:brightness-75 transform-gpu transition-all w-fit")}>
<div className="flex flex-col text-sm">
<p className="text-gray-400">{leaderboard.songAuthorName}</p>
<FallbackLink
href={mappersProfile}
className={mappersProfile && "hover:brightness-75 transform-gpu transition-all w-fit"}
>
{leaderboard.levelAuthorName}
</p>
</FallbackLink>
</FallbackLink>
</div>
</div>
</div>
</div>