-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |