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,26 +6,38 @@ import './index.css'
interface Props {
type: 'character' | 'weapon' | 'summon'
rarity?: number
uncapLevel: number
flb: boolean
ulb: boolean
ulb?: boolean
}
const UncapIndicator = (props: Props) => {
let numStars
if (props.ulb) {
numStars = 5
} else if (props.flb) {
numStars = 4
if (props.type === 'character') {
if (props.flb) {
numStars = 5
} else {
numStars = 4
}
} else {
numStars = 3
if (props.ulb) {
numStars = 5
} else if (props.flb) {
numStars = 4
} else {
numStars = 3
}
}
return (
<ul className="UncapIndicator">
{
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}`} />
} else {
return <UncapStar uncap={false} key={`star_${i}`} />