show more data on the #1 feed
This commit is contained in:
@ -1,11 +1,9 @@
|
||||
import { formatNumberWithCommas } from "@ssr/common/utils/number-utils";
|
||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import clsx from "clsx";
|
||||
import { getScoreBadgeFromAccuracy } from "@/common/song-utils";
|
||||
import Tooltip from "@/components/tooltip";
|
||||
import { ScoreBadge, ScoreBadges } from "@/components/score/score-badge";
|
||||
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
|
||||
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
|
||||
import FullComboBadge from "@/components/score/badges/full-combo";
|
||||
|
||||
const badges: ScoreBadge[] = [
|
||||
{
|
||||
@ -57,14 +55,7 @@ const badges: ScoreBadge[] = [
|
||||
{
|
||||
name: "Full Combo",
|
||||
create: (score: ScoreSaberScore) => {
|
||||
const fullCombo = score.misses === 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<p>{fullCombo ? <span className="text-green-400">FC</span> : formatNumberWithCommas(score.misses)}</p>
|
||||
<XMarkIcon className={clsx("w-5 h-5", fullCombo ? "hidden" : "text-red-400")} />
|
||||
</>
|
||||
);
|
||||
return <FullComboBadge score={score} />;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -0,0 +1,8 @@
|
||||
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
|
||||
|
||||
export type ScoreBadgeProps = {
|
||||
/**
|
||||
* The score for this badge
|
||||
*/
|
||||
score: ScoreSaberScore;
|
||||
};
|
29
projects/website/src/components/score/badges/full-combo.tsx
Normal file
29
projects/website/src/components/score/badges/full-combo.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import { formatNumberWithCommas } from "@ssr/common/utils/number-utils";
|
||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import clsx from "clsx";
|
||||
import Tooltip from "@/components/tooltip";
|
||||
import { ScoreBadgeProps } from "@/components/score/badges/badge-props";
|
||||
|
||||
export default function FullComboBadge({ score }: ScoreBadgeProps) {
|
||||
return (
|
||||
<Tooltip
|
||||
display={
|
||||
<div className="flex flex-col justify-center items-center">
|
||||
{!score.fullCombo ? (
|
||||
<>
|
||||
<p>Missed Notes: {formatNumberWithCommas(score.missedNotes)}</p>
|
||||
<p>Bad Cuts: {formatNumberWithCommas(score.badCuts)}</p>
|
||||
</>
|
||||
) : (
|
||||
<p>Full Combo</p>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="flex gap-1">
|
||||
<p>{score.fullCombo ? <span className="text-green-400">FC</span> : formatNumberWithCommas(score.misses)}</p>
|
||||
<XMarkIcon className={clsx("w-5 h-5", score.fullCombo ? "hidden" : "text-red-400")} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
@ -1,11 +1,10 @@
|
||||
import { formatNumberWithCommas, formatPp } from "@ssr/common/utils/number-utils";
|
||||
import { getScoreBadgeFromAccuracy } from "@/common/song-utils";
|
||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import clsx from "clsx";
|
||||
import Tooltip from "@/components/tooltip";
|
||||
import { ScoreBadge, ScoreBadges } from "@/components/score/score-badge";
|
||||
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
|
||||
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
|
||||
import FullComboBadge from "@/components/score/badges/full-combo";
|
||||
|
||||
const badges: ScoreBadge[] = [
|
||||
{
|
||||
@ -88,33 +87,7 @@ const badges: ScoreBadge[] = [
|
||||
{
|
||||
name: "Full Combo",
|
||||
create: (score: ScoreSaberScore) => {
|
||||
return (
|
||||
<Tooltip
|
||||
display={
|
||||
<div className="flex flex-col justify-center items-center">
|
||||
{!score.fullCombo ? (
|
||||
<>
|
||||
<p>Missed Notes: {formatNumberWithCommas(score.misses)}</p>
|
||||
<p>Bad Cuts: {formatNumberWithCommas(score.badCuts)}</p>
|
||||
</>
|
||||
) : (
|
||||
<p>Full Combo</p>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="flex gap-1">
|
||||
<p>
|
||||
{score.fullCombo ? (
|
||||
<span className="text-green-400">FC</span>
|
||||
) : (
|
||||
formatNumberWithCommas(score.misses + score.badCuts)
|
||||
)}
|
||||
</p>
|
||||
<XMarkIcon className={clsx("w-5 h-5", score.fullCombo ? "hidden" : "text-red-400")} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
);
|
||||
return <FullComboBadge score={score} />;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
Reference in New Issue
Block a user