From f7d97774acb356495d6eef8710a9e47b904cfe0e Mon Sep 17 00:00:00 2001 From: Sendou Date: Sun, 10 Nov 2019 16:30:22 +0200 Subject: [PATCH] rotations removed preference selector --- .../components/rotation/RotationSegments.js | 37 ++--------------- react-ui/src/components/rotation/Rotations.js | 41 +++---------------- schemas/placement.js | 1 - 3 files changed, 10 insertions(+), 69 deletions(-) diff --git a/react-ui/src/components/rotation/RotationSegments.js b/react-ui/src/components/rotation/RotationSegments.js index 24bdd507d..2c4da32d2 100644 --- a/react-ui/src/components/rotation/RotationSegments.js +++ b/react-ui/src/components/rotation/RotationSegments.js @@ -6,14 +6,7 @@ import rankedIcon from "../../assets/ranked.png" import leagueIcon from "../../assets/league.png" import regularIcon from "../../assets/regular.png" -const modeShort = { - "Splat Zones": "sz", - "Tower Control": "tc", - Rainmaker: "rm", - "Clam Blitz": "cb" -} - -const RotationSegments = ({ rotation, preferences }) => { +const RotationSegments = ({ rotation }) => { const [currentTime, setCurrentTime] = useState( new Date(Math.floor(Date.now() / 1000)) ) @@ -46,13 +39,7 @@ const RotationSegments = ({ rotation, preferences }) => {
{header}
- + @@ -128,28 +115,12 @@ const RotationSegments = ({ rotation, preferences }) => { }} > - } + trigger={} content={r.stage_a.name} basic /> - } + trigger={} content={r.stage_b.name} basic /> diff --git a/react-ui/src/components/rotation/Rotations.js b/react-ui/src/components/rotation/Rotations.js index 2535f6f81..c82ab0a07 100644 --- a/react-ui/src/components/rotation/Rotations.js +++ b/react-ui/src/components/rotation/Rotations.js @@ -1,60 +1,31 @@ import React, { useEffect, useState } from "react" import { useQuery } from "@apollo/react-hooks" import { rotationData } from "../../graphql/queries/rotationData" -import { maplists } from "../../graphql/queries/maplists" -import { Button } from "semantic-ui-react" import Loading from "../common/Loading" import Error from "../common/Error" -import MapPreferenceSelector from "./MapPreferenceSelector" import RotationSegments from "./RotationSegments" -const Rotations = ({ setMenuSelection }) => { +const Rotations = () => { const { data, error, loading } = useQuery(rotationData) - const monthly = useQuery(maplists) const [rotation, setRotation] = useState([]) - const [preferences, setPreferences] = useState({ - sz: {}, - tc: {}, - rm: {}, - cb: {} - }) - - const [show, setShow] = useState(false) useEffect(() => { - if (loading || monthly.loading) { + if (loading) { return } document.title = "Rotations - sendou.ink" - const rotationPreferencesFromDb = window.localStorage.getItem( - "rotationPreferences" - ) - if (rotationPreferencesFromDb) { - setPreferences(JSON.parse(rotationPreferencesFromDb)) - } setRotation(JSON.parse(data.rotationData)) - }, [data, loading, monthly.loading]) + }, [data, loading]) - if (loading || monthly.loading || rotation.length === 0) return - if (error || monthly.error) return - - const monthlyMaps = monthly.data.maplists[0] + if (loading || rotation.length === 0) return + if (error) return return ( <> -