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

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

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