deal with console errors

This commit is contained in:
Sendou 2020-06-27 14:28:33 +03:00
parent 895b48cdac
commit 03303cfbcb
19 changed files with 16 additions and 46 deletions

View File

@ -23,7 +23,7 @@ import InfiniteScroll from "react-infinite-scroller"
import PageHeader from "../common/PageHeader"
import AbilitySelector from "./AbilitySelector"
import Alert from "../elements/Alert"
import { useTranslation, Trans } from "react-i18next"
import { useTranslation } from "react-i18next"
const BuildsPage: React.FC<RouteComponentProps> = () => {
const { themeColor } = useContext(MyThemeContext)

View File

@ -11,7 +11,6 @@ import {
} from "../../graphql/queries/upcomingEvents"
import MyThemeContext from "../../themeContext"
import { getWeek } from "../../utils/helperFunctions"
import { days } from "../../utils/lists"
import Error from "../common/Error"
import Loading from "../common/Loading"
import PageHeader from "../common/PageHeader"
@ -19,12 +18,6 @@ import SubHeader from "../common/SubHeader"
import Input from "../elements/Input"
import TournamentInfo from "./TournamentInfo"
const badgeColor: { [key: string]: string } = {
Friday: "purple",
Saturday: "green",
Sunday: "blue",
} as const
const CalendarPage: React.FC<RouteComponentProps> = () => {
const { darkerBgColor, grayWithShade } = useContext(MyThemeContext)
const { t, i18n } = useTranslation()
@ -77,7 +70,6 @@ const CalendarPage: React.FC<RouteComponentProps> = () => {
const time = new Date(parseInt(event.date))
const weekNumber = getWeek(time)
const thisDay = time.getDate()
const thisDayOfTheWeek = days[time.getDay()]
const thisMonth = time.getMonth()
const printWeekHeader = weekNumber !== lastPrintedWeek
const printDayHeader =
@ -90,8 +82,6 @@ const CalendarPage: React.FC<RouteComponentProps> = () => {
lastPrintedMonth = thisMonth
}
const colorForBadge = badgeColor[thisDayOfTheWeek] ?? "red"
return (
<React.Fragment key={event.discord_invite_url}>
{printWeekHeader ? (

View File

@ -1,6 +1,5 @@
import React from "react"
import { CountryCode } from "../../types"
import { countries } from "../../utils/lists"
import { useTranslation } from "react-i18next"
interface FlagProps {

View File

@ -29,12 +29,12 @@ const RadioGroup: React.FC<RadioGroupProps> = ({
onChange={(e) => setValue(e.target.value)}
value={value}
>
{options.map(({ label, value }) => (
{options.map(({ label, value: valueOfOption }) => (
<Radio
key={value}
key={valueOfOption}
variantColor={themeColor}
value={value}
isChecked={value === value}
value={valueOfOption}
isChecked={valueOfOption === value}
>
{label}
</Radio>

View File

@ -6,7 +6,6 @@ import { Link } from "@reach/router"
import MyThemeContext from "../../themeContext"
import { FaTwitter, FaPlus, FaMinus } from "react-icons/fa"
import { top500 } from "../../assets/imageImports"
import { countries } from "../../utils/lists"
import Flag from "../common/Flag"
import RoleIcons from "./RoleIcons"
import WeaponImage from "../common/WeaponImage"

View File

@ -27,7 +27,7 @@ import {
} from "../../graphql/queries/freeAgentMatches"
import Matches from "./Matches"
import Alert from "../elements/Alert"
import { useTranslation, Trans } from "react-i18next"
import { useTranslation } from "react-i18next"
const playstyleToEnum = {
"Frontline/Slayer": "FRONTLINE",
@ -167,10 +167,6 @@ const FreeAgentsPage: React.FC<RouteComponentProps> = () => {
)
}
const name = userData!.user!.username
const disc = userData!.user!.discord_id
const matchFullName = `${name}#${disc}`
return (
<>
<Helmet>

View File

@ -49,8 +49,6 @@ const Stats: React.FC = () => {
return <>{value}</>
}
const getStatString = (_asd: any) => 2
const xRankMonthCount = xRankMonths()
return (

View File

@ -1,10 +1,7 @@
import { Box, Flex, Icon, Image } from "@chakra-ui/core"
import { Link } from "@reach/router"
import { Box, Image } from "@chakra-ui/core"
import React, { useContext, useState, Suspense } from "react"
import { FaGithub, FaTwitch, FaTwitter } from "react-icons/fa"
import { footerOcto, footerSquid } from "../../assets/imageImports"
import MyThemeContext from "../../themeContext"
import { useTranslation } from "react-i18next"
import FooterContent from "./FooterContent"
const Footer: React.FC = () => {

View File

@ -5,11 +5,9 @@ import { Link } from "@reach/router"
import { FaGithub } from "react-icons/fa"
import MyThemeContext from "../../themeContext"
interface FooterContentProps {}
const FooterContent: React.FC<FooterContentProps> = ({}) => {
const FooterContent: React.FC = () => {
const { t } = useTranslation()
const { themeColorWithShade, colorMode } = useContext(MyThemeContext)
const { themeColorWithShade } = useContext(MyThemeContext)
return (
<Flex
bg={themeColorWithShade}

View File

@ -1,4 +1,4 @@
import React, { useContext, Suspense } from "react"
import React, { useContext } from "react"
import {
IconButton,
useColorMode,

View File

@ -1,4 +1,4 @@
import React, { useContext, useState } from "react"
import React, { useContext } from "react"
import { ComposableMap, Geographies, Geography } from "react-simple-maps"
import { CountryCode } from "../../types"
import MyThemeContext from "../../themeContext"

View File

@ -1,6 +1,5 @@
import React, { useContext } from "react"
import React from "react"
import { Avatar, Flex, Box } from "@chakra-ui/core"
import MyThemeContext from "../../themeContext"
interface LogoHeaderProps {
name: string

View File

@ -5,7 +5,6 @@ import { Helmet } from "react-helmet-async"
import Chart from "./Chart"
import TeamPlayer from "./TeamPlayer"
import LogoHeader from "./LogoHeader"
import USAChart from "./USAChart"
import Markdown from "../elements/Markdown"
const TeamPage: React.FC<RouteComponentProps> = () => {

View File

@ -1,6 +1,6 @@
import React, { useContext } from "react"
import { Placement } from "../../types"
import { modesShort, months } from "../../utils/lists"
import { modesShort } from "../../utils/lists"
import {
Accordion,
AccordionItem,

View File

@ -66,7 +66,7 @@ const ProfileModal: React.FC<ProfileModalProps> = ({
} else {
setError(null)
}
}, [profile])
}, [profile, t])
const handleChange = (newValueObject: UpdateUserVars) => {
setProfile({ ...profile, ...newValueObject })

View File

@ -32,7 +32,6 @@ import {
import { weapons } from "../../utils/lists"
import Error from "../common/Error"
import Loading from "../common/Loading"
import Alert from "../elements/Alert"
import Markdown from "../elements/Markdown"
import AvatarWithInfo from "./AvatarWithInfo"
import BuildTab from "./BuildTab"

View File

@ -14,7 +14,7 @@ import {
import useBreakPoints from "../../hooks/useBreakPoints"
import MyThemeContext from "../../themeContext"
import { Weapon } from "../../types"
import { modesShort, months } from "../../utils/lists"
import { modesShort } from "../../utils/lists"
import Error from "../common/Error"
import Loading from "../common/Loading"
import PageHeader from "../common/PageHeader"

View File

@ -4,7 +4,6 @@ import sz from "../../assets/sz.png"
import tc from "../../assets/tc.png"
import rm from "../../assets/rm.png"
import cb from "../../assets/cb.png"
import tw from "../../assets/tw.png"
import { useTranslation } from "react-i18next"
interface ModeButtonsProps {

View File

@ -23,10 +23,7 @@ import WeaponLineChart from "./WeaponLineChart"
import { Helmet } from "react-helmet-async"
import Alert from "../elements/Alert"
import { useTranslation } from "react-i18next"
import {
getLocalizedMonthYearString,
parseAndGetLocalizedMonthYear,
} from "../../utils/helperFunctions"
import { parseAndGetLocalizedMonthYear } from "../../utils/helperFunctions"
const tiers = [
{