From 725e989bd7b3acfe4a76d4647876b8952b44f1ff Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 30 Nov 2022 05:21:11 -0800 Subject: [PATCH] Remove console logs --- components/JobSection/index.tsx | 4 - components/SearchModal/index.tsx | 3 - components/UncapIndicator/index.tsx | 192 ++++++++++++++++------------ 3 files changed, 110 insertions(+), 89 deletions(-) diff --git a/components/JobSection/index.tsx b/components/JobSection/index.tsx index d1737df1..37efada4 100644 --- a/components/JobSection/index.tsx +++ b/components/JobSection/index.tsx @@ -47,10 +47,6 @@ const JobSection = (props: Props) => { setSkillRefs(Array(numSkills).fill(React.createRef())) }, [numSkills]) - useEffect(() => { - console.log(skillRefs) - }, [skillRefs]) - function receiveJob(job?: Job) { console.log(`Receiving job! Row ${job?.row}: ${job?.name.en}`) if (job) { diff --git a/components/SearchModal/index.tsx b/components/SearchModal/index.tsx index 317ab5eb..9ba47017 100644 --- a/components/SearchModal/index.tsx +++ b/components/SearchModal/index.tsx @@ -71,7 +71,6 @@ const SearchModal = (props: Props) => { } function fetchResults({ replace = false }: { replace?: boolean }) { - console.log("Fetch results!!!") api .search({ object: props.object, @@ -82,8 +81,6 @@ const SearchModal = (props: Props) => { page: currentPage, }) .then((response) => { - console.log("resp") - console.log(response) setTotalPages(response.data.total_pages) setRecordCount(response.data.count) diff --git a/components/UncapIndicator/index.tsx b/components/UncapIndicator/index.tsx index 56de4114..eb292067 100644 --- a/components/UncapIndicator/index.tsx +++ b/components/UncapIndicator/index.tsx @@ -1,101 +1,129 @@ -import React, { useEffect, useRef, useState } from 'react' -import UncapStar from '~components/UncapStar' +import React, { useEffect, useRef, useState } from "react" +import UncapStar from "~components/UncapStar" -import './index.scss' +import "./index.scss" interface Props { - type: 'character' | 'weapon' | 'summon' - rarity?: number - uncapLevel?: number - flb: boolean - ulb: boolean - special: boolean - updateUncap?: (uncap: number) => void + type: "character" | "weapon" | "summon" + rarity?: number + uncapLevel?: number + flb: boolean + ulb: boolean + special: boolean + updateUncap?: (uncap: number) => void } const UncapIndicator = (props: Props) => { - const [uncap, setUncap] = useState(props.uncapLevel) + const [uncap, setUncap] = useState(props.uncapLevel) - const numStars = setNumStars() - function setNumStars() { - let numStars - - if (props.type === 'character') { - if (props.special) { - if (props.ulb) { - numStars = 5 - } else if (props.flb) { - numStars = 4 - } else { - numStars = 3 - } - } else { - if (props.ulb) { - numStars = 6 - } else if (props.flb) { - numStars = 5 - } else { - numStars = 4 - } - } + const numStars = setNumStars() + function setNumStars() { + let numStars + + if (props.type === "character") { + if (props.special) { + if (props.ulb) { + numStars = 5 + } else if (props.flb) { + numStars = 4 } else { - if (props.ulb) { - numStars = 5 - } else if (props.flb) { - numStars = 4 - } else { - numStars = 3 - } + numStars = 3 } - - return numStars - } - - function toggleStar(index: number, empty: boolean) { - if (props.updateUncap) { - if (empty) props.updateUncap(index + 1) - else props.updateUncap(index) + } else { + if (props.ulb) { + numStars = 6 + } else if (props.flb) { + numStars = 5 + } else { + numStars = 4 } + } + } else { + if (props.ulb) { + numStars = 5 + } else if (props.flb) { + numStars = 4 + } else { + numStars = 3 + } } - const transcendence = (i: number) => { - return = props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} /> - } + return numStars + } - const ulb = (i: number) => { - return = props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} /> - } - - const flb = (i: number) => { - return = props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} /> - } - - const mlb = (i: number) => { - // console.log("MLB; Number of stars:", props.uncapLevel) - return = props.uncapLevel : false } key={`star_${i}`} index={i} onClick={toggleStar} /> + function toggleStar(index: number, empty: boolean) { + if (props.updateUncap) { + if (empty) props.updateUncap(index + 1) + else props.updateUncap(index) } + } + const transcendence = (i: number) => { return ( -
    - { - 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) - } - }) - } -
+ = props.uncapLevel : false} + key={`star_${i}`} + index={i} + onClick={toggleStar} + /> ) + } + + const ulb = (i: number) => { + return ( + = props.uncapLevel : false} + key={`star_${i}`} + index={i} + onClick={toggleStar} + /> + ) + } + + const flb = (i: number) => { + return ( + = props.uncapLevel : false} + key={`star_${i}`} + index={i} + onClick={toggleStar} + /> + ) + } + + const mlb = (i: number) => { + // console.log("MLB; Number of stars:", props.uncapLevel) + return ( + = props.uncapLevel : false} + key={`star_${i}`} + index={i} + onClick={toggleStar} + /> + ) + } + + return ( +
    + {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) + } + })} +
+ ) } -export default UncapIndicator \ No newline at end of file +export default UncapIndicator