add bl replay button
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m25s

This commit is contained in:
Lee 2024-10-22 18:20:34 +01:00
parent 75f79e34b7
commit 7b87188e98
3 changed files with 25 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

@ -0,0 +1,9 @@
import Image from "next/image";
type BeatSaberPepeLogoProps = {
size?: number;
};
export default function BeatSaberPepeLogo({ size = 32 }: BeatSaberPepeLogoProps) {
return <Image width={size} height={size} unoptimized src={"/assets/bs-pepe.gif"} alt={"BeatSaber Pepe Logo"}></Image>;
}

@ -13,6 +13,7 @@ import ScoreEditorButton from "@/components/score/score-editor-button";
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
import { BeatSaverMap } from "@ssr/common/model/beatsaver/beatsaver-map";
import BeatSaberPepeLogo from "@/components/logos/beatsaber-pepe-logo";
type Props = {
score?: ScoreSaberScore;
@ -34,6 +35,7 @@ export default function ScoreButtons({
const [leaderboardExpanded, setLeaderboardExpanded] = useState(false);
const { toast } = useToast();
const additionalData = score?.additionalData;
return (
<div className={`flex justify-end gap-2 items-center`}>
<div
@ -79,6 +81,20 @@ export default function ScoreButtons({
>
<YouTubeLogo />
</ScoreButton>
{additionalData != undefined && (
<>
{/* Open score replay */}
<ScoreButton
onClick={() => {
window.open(`https://replay.beatleader.xyz/?scoreId=${additionalData.scoreId}`, "_blank");
}}
tooltip={<p>Click to view the score replay!</p>}
>
<BeatSaberPepeLogo />
</ScoreButton>
</>
)}
</div>
<div
className={`flex gap-2 ${alwaysSingleLine ? "flex-row" : "flex-row lg:flex-col"} items-center justify-center`}