Update to work with Character's different stars

This commit is contained in:
Justin Edmund 2020-10-19 05:12:24 -07:00
parent 320bbf9f3a
commit 20dc930f5c

View file

@ -6,13 +6,23 @@ import './index.css'
interface Props { interface Props {
type: 'character' | 'weapon' | 'summon'
rarity?: number
uncapLevel: number uncapLevel: number
flb: boolean flb: boolean
ulb: boolean ulb?: boolean
} }
const UncapIndicator = (props: Props) => { const UncapIndicator = (props: Props) => {
let numStars let numStars
if (props.type === 'character') {
if (props.flb) {
numStars = 5
} else {
numStars = 4
}
} else {
if (props.ulb) { if (props.ulb) {
numStars = 5 numStars = 5
} else if (props.flb) { } else if (props.flb) {
@ -20,12 +30,14 @@ const UncapIndicator = (props: Props) => {
} else { } else {
numStars = 3 numStars = 3
} }
}
return ( return (
<ul className="UncapIndicator"> <ul className="UncapIndicator">
{ {
Array.from(Array(numStars)).map((x, i) => { Array.from(Array(numStars)).map((x, i) => {
if (i > 2) { if (props.type === 'character' && i > 3 ||
props.type !== 'character' && i > 2) {
return <UncapStar uncap={true} key={`star_${i}`} /> return <UncapStar uncap={true} key={`star_${i}`} />
} else { } else {
return <UncapStar uncap={false} key={`star_${i}`} /> return <UncapStar uncap={false} key={`star_${i}`} />