fix mapper link for song to
All checks were successful
Deploy Website / deploy (push) Successful in 5m3s
All checks were successful
Deploy Website / deploy (push) Successful in 5m3s
This commit is contained in:
parent
783da27b1e
commit
b7783f5a4d
@ -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>
|
||||
) : (
|
||||
|
@ -70,14 +70,17 @@ 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user