Skip to content

Commit

Permalink
releasef spot count for 3s and rbg
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammers21 committed Apr 20, 2024
1 parent 63d8dc7 commit 8aa04fd
Showing 1 changed file with 43 additions and 41 deletions.
84 changes: 43 additions & 41 deletions frontend/src/components/TableFilter/CutOffRating.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
import { getRatingColor, getSeasonRankImageFromRating } from '@/utils/table';

interface IProps {
bracket: string;
statistic: any;
}

const ratingRewardMap = {
'3v3': 'ARENA_3v3',
rbg: 'BATTLEGROUNDS/alliance',
};

const CutOffText = ({ bracket, statistic }: IProps) => {
const rankOneTitleColor = getRatingColor(true);

const rewards = statistic?.cutoffs?.rewards;
const cutOffRating = rewards?.[ratingRewardMap[bracket]];

return (
<span className="text-xs sm:text-lg font-light" style={{ color: rankOneTitleColor }}>
{bracket === '3v3'
? `Verdant Gladiator: Dragonflight Season 3 - Rating: ${cutOffRating}`
: `Hero of the Alliance & Horde: Verdant - Rating: ${cutOffRating}`}
</span>
);
};

const CutOffRating = ({ bracket, statistic }: IProps) => {
if (!statistic?.cutoffs?.rewards?.ARENA_3v3 || !['rbg', '3v3'].includes(bracket)) {
return <div></div>;
}

return (
<div className="flex items-center mr-2">
<img className="w-7 h-7 mr-2" src={getSeasonRankImageFromRating(0, true)} alt="Season Rank" />
<CutOffText statistic={statistic} bracket={bracket} />
</div>
);
};

export default CutOffRating;
import { getRatingColor, getSeasonRankImageFromRating } from '@/utils/table';

interface IProps {
bracket: string;
statistic: any;
}

const ratingRewardMap = {
'3v3': 'ARENA_3v3',
rbg: 'BATTLEGROUNDS/alliance',
};

const CutOffText = ({ bracket, statistic }: IProps) => {
const rankOneTitleColor = getRatingColor(true);

const rewards = statistic?.cutoffs?.rewards;
const spotWithNoAlts = statistic?.cutoffs?.spotWithNoAlts
const cutOffRating = rewards?.[ratingRewardMap[bracket]];
const spotsWithNoAlts = spotWithNoAlts?.[ratingRewardMap[bracket]];

return (
<span className="text-xs sm:text-lg font-light" style={{ color: rankOneTitleColor }}>
{bracket === '3v3'
? `Verdant Gladiator: Dragonflight Season 3 - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`
: `Hero of the Alliance & Horde: Verdant - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`}
</span>
);
};

const CutOffRating = ({ bracket, statistic }: IProps) => {
if (!statistic?.cutoffs?.rewards?.ARENA_3v3 || !['rbg', '3v3'].includes(bracket)) {
return <div></div>;
}

return (
<div className="flex items-center mr-2">
<img className="w-7 h-7 mr-2" src={getSeasonRankImageFromRating(0, true)} alt="Season Rank" />
<CutOffText statistic={statistic} bracket={bracket} />
</div>
);
};

export default CutOffRating;

0 comments on commit 8aa04fd

Please sign in to comment.