Remove console logs

This commit is contained in:
Justin Edmund 2022-11-30 05:21:11 -08:00
parent 6ef73583df
commit 725e989bd7
3 changed files with 110 additions and 89 deletions

View file

@ -47,10 +47,6 @@ const JobSection = (props: Props) => {
setSkillRefs(Array(numSkills).fill(React.createRef<HTMLDivElement>())) setSkillRefs(Array(numSkills).fill(React.createRef<HTMLDivElement>()))
}, [numSkills]) }, [numSkills])
useEffect(() => {
console.log(skillRefs)
}, [skillRefs])
function receiveJob(job?: Job) { function receiveJob(job?: Job) {
console.log(`Receiving job! Row ${job?.row}: ${job?.name.en}`) console.log(`Receiving job! Row ${job?.row}: ${job?.name.en}`)
if (job) { if (job) {

View file

@ -71,7 +71,6 @@ const SearchModal = (props: Props) => {
} }
function fetchResults({ replace = false }: { replace?: boolean }) { function fetchResults({ replace = false }: { replace?: boolean }) {
console.log("Fetch results!!!")
api api
.search({ .search({
object: props.object, object: props.object,
@ -82,8 +81,6 @@ const SearchModal = (props: Props) => {
page: currentPage, page: currentPage,
}) })
.then((response) => { .then((response) => {
console.log("resp")
console.log(response)
setTotalPages(response.data.total_pages) setTotalPages(response.data.total_pages)
setRecordCount(response.data.count) setRecordCount(response.data.count)

View file

@ -1,101 +1,129 @@
import React, { useEffect, useRef, useState } from 'react' import React, { useEffect, useRef, useState } from "react"
import UncapStar from '~components/UncapStar' import UncapStar from "~components/UncapStar"
import './index.scss' import "./index.scss"
interface Props { interface Props {
type: 'character' | 'weapon' | 'summon' type: "character" | "weapon" | "summon"
rarity?: number rarity?: number
uncapLevel?: number uncapLevel?: number
flb: boolean flb: boolean
ulb: boolean ulb: boolean
special: boolean special: boolean
updateUncap?: (uncap: number) => void updateUncap?: (uncap: number) => void
} }
const UncapIndicator = (props: Props) => { const UncapIndicator = (props: Props) => {
const [uncap, setUncap] = useState(props.uncapLevel) const [uncap, setUncap] = useState(props.uncapLevel)
const numStars = setNumStars() const numStars = setNumStars()
function setNumStars() { function setNumStars() {
let numStars let numStars
if (props.type === 'character') { if (props.type === "character") {
if (props.special) { if (props.special) {
if (props.ulb) { if (props.ulb) {
numStars = 5 numStars = 5
} else if (props.flb) { } else if (props.flb) {
numStars = 4 numStars = 4
} else {
numStars = 3
}
} else {
if (props.ulb) {
numStars = 6
} else if (props.flb) {
numStars = 5
} else {
numStars = 4
}
}
} else { } else {
if (props.ulb) { numStars = 3
numStars = 5
} else if (props.flb) {
numStars = 4
} else {
numStars = 3
}
} }
} else {
return numStars if (props.ulb) {
} numStars = 6
} else if (props.flb) {
function toggleStar(index: number, empty: boolean) { numStars = 5
if (props.updateUncap) { } else {
if (empty) props.updateUncap(index + 1) numStars = 4
else props.updateUncap(index)
} }
}
} else {
if (props.ulb) {
numStars = 5
} else if (props.flb) {
numStars = 4
} else {
numStars = 3
}
} }
const transcendence = (i: number) => { return numStars
return <UncapStar ulb={true} empty={ (props.uncapLevel) ? i >= props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} /> }
}
const ulb = (i: number) => { function toggleStar(index: number, empty: boolean) {
return <UncapStar ulb={true} empty={ (props.uncapLevel) ? i >= props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} /> if (props.updateUncap) {
} if (empty) props.updateUncap(index + 1)
else props.updateUncap(index)
const flb = (i: number) => {
return <UncapStar flb={true} empty={ (props.uncapLevel) ? i >= props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} />
}
const mlb = (i: number) => {
// console.log("MLB; Number of stars:", props.uncapLevel)
return <UncapStar empty={ (props.uncapLevel) ? i >= props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} />
} }
}
const transcendence = (i: number) => {
return ( return (
<ul className="UncapIndicator"> <UncapStar
{ ulb={true}
Array.from(Array(numStars)).map((x, i) => { empty={props.uncapLevel ? i >= props.uncapLevel : false}
if (props.type === 'character' && i > 4) { key={`star_${i}`}
if (props.special) index={i}
return ulb(i) onClick={toggleStar}
else />
return transcendence(i)
} else if (
props.special && props.type === 'character' && i == 3 ||
props.type === 'character' && i == 4 ||
props.type !== 'character' && i > 2) {
return flb(i)
} else {
return mlb(i)
}
})
}
</ul>
) )
}
const ulb = (i: number) => {
return (
<UncapStar
ulb={true}
empty={props.uncapLevel ? i >= props.uncapLevel : false}
key={`star_${i}`}
index={i}
onClick={toggleStar}
/>
)
}
const flb = (i: number) => {
return (
<UncapStar
flb={true}
empty={props.uncapLevel ? i >= props.uncapLevel : false}
key={`star_${i}`}
index={i}
onClick={toggleStar}
/>
)
}
const mlb = (i: number) => {
// console.log("MLB; Number of stars:", props.uncapLevel)
return (
<UncapStar
empty={props.uncapLevel ? i >= props.uncapLevel : false}
key={`star_${i}`}
index={i}
onClick={toggleStar}
/>
)
}
return (
<ul className="UncapIndicator">
{Array.from(Array(numStars)).map((x, i) => {
if (props.type === "character" && i > 4) {
if (props.special) return ulb(i)
else return transcendence(i)
} else if (
(props.special && props.type === "character" && i == 3) ||
(props.type === "character" && i == 4) ||
(props.type !== "character" && i > 2)
) {
return flb(i)
} else {
return mlb(i)
}
})}
</ul>
)
} }
export default UncapIndicator export default UncapIndicator