From cd1262044a69edb2bbc279862da0fe2ad45e71ec Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 3 Jul 2022 01:44:30 +0100 Subject: [PATCH] feat: tear out challenges, they don't work --- .../rivals/ReceivedChallengesPage.tsx | 35 ---------------- .../_game/_playtype/rivals/RivalsMainPage.tsx | 21 ++++------ .../_playtype/rivals/RivalsOverviewPage.tsx | 41 ++----------------- client/src/components/user/UGPTHeader.tsx | 4 +- .../src/components/user/UGPTStatsOverview.tsx | 1 - 5 files changed, 15 insertions(+), 87 deletions(-) delete mode 100644 client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/ReceivedChallengesPage.tsx diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/ReceivedChallengesPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/ReceivedChallengesPage.tsx deleted file mode 100644 index ec5fc00ef..000000000 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/ReceivedChallengesPage.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import ApiError from "components/util/ApiError"; -import DebugContent from "components/util/DebugContent"; -import Loading from "components/util/Loading"; -import useApiQuery from "components/util/query/useApiQuery"; -import React from "react"; -import { Game, Playtype, PublicUserDocument } from "tachi-common"; -import { ChallengeSubsReturn } from "types/api-returns"; - -export default function ReceivedChallengesPage({ - reqUser, - game, - playtype, -}: { - reqUser: PublicUserDocument; - game: Game; - playtype: Playtype; -}) { - const { data, isLoading, error } = useApiQuery( - `/users/${reqUser.id}/games/${game}/${playtype}/challenges/subs` - ); - - if (error) { - ; - } - - if (isLoading || !data) { - return ; - } - - return ( -
- -
- ); -} diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx index 7e5f35b99..c805c0b5d 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx @@ -7,7 +7,6 @@ import React from "react"; import { Row, Col } from "react-bootstrap"; import { Switch, Route } from "react-router-dom"; import { FormatGame, Game, GetGameConfig, Playtype, PublicUserDocument } from "tachi-common"; -import ReceivedChallengesPage from "./ReceivedChallengesPage"; import RivalsOverviewPage from "./RivalsOverviewPage"; export default function RivalsMainPage({ @@ -34,16 +33,16 @@ export default function RivalsMainPage({
- - Sent Challenges + + Rival Score Feed - Rivals + Manage Rivals - - - Received Challenges + + + Pinned Charts
@@ -55,14 +54,12 @@ export default function RivalsMainPage({ - - + path="/dashboard/users/:userID/games/:game/:playtype/rivals/pinned-charts" + > diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsOverviewPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsOverviewPage.tsx index 02f84f0c0..4caef4563 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsOverviewPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsOverviewPage.tsx @@ -1,22 +1,18 @@ import { APIFetchV1 } from "util/api"; import { SendErrorToast } from "util/toaster"; -import ProfilePicture from "components/user/ProfilePicture"; +import Card from "components/layout/page/Card"; import ApiError from "components/util/ApiError"; import Divider from "components/util/Divider"; import Icon from "components/util/Icon"; import Loading from "components/util/Loading"; +import UserSelectModal from "components/util/modal/UserSelectModal"; import Muted from "components/util/Muted"; import useApiQuery from "components/util/query/useApiQuery"; +import UserIcon from "components/util/UserIcon"; import { UserContext } from "context/UserContext"; import React, { useContext, useEffect, useState } from "react"; -import { Alert, Button, Col, Row } from "react-bootstrap"; -import { Link } from "react-router-dom"; +import { Button, Col } from "react-bootstrap"; import { Game, Playtype, PublicUserDocument } from "tachi-common"; -import { GamePT, JustChildren } from "types/react"; -import UserSelectModal from "components/util/modal/UserSelectModal"; -import UserIcon from "components/util/UserIcon"; -import Card from "components/layout/page/Card"; -import { TachiConfig } from "lib/config"; export default function RivalsOverviewWrapper({ reqUser, @@ -105,35 +101,6 @@ function RivalsOverviewPage({ return ( <> - {isRequestingUser && ( - <> - - By setting Rivals on this page, {TachiConfig.name} will restructure parts of - the UI to tell you how your Rivals are doing. - {game === "bms" && ( - <> -
- If you're using the beatoraja IR, your rivals will{" "} - automatically work in game! - - )} - - By rivalling a user, you also subscribe to their challenges. This is - another {TachiConfig.name} feature that goes hand-in-hand with rivals! -
- You'll automatically be notified when they send out a new challenge, and you - can track your challenges using the above buttons. -
- You can also send out challenges. All your Reverse Rivals (and anyone who - rivals you in the future) will receive it. -
- Just click any PB of yours that you're proud of, and click{" "} - Set Challenge! -
- - - )} - {rivals.map(e => ( diff --git a/client/src/components/user/UGPTHeader.tsx b/client/src/components/user/UGPTHeader.tsx index b157b2e68..d5d2bc26d 100644 --- a/client/src/components/user/UGPTHeader.tsx +++ b/client/src/components/user/UGPTHeader.tsx @@ -103,10 +103,10 @@ export function UGPTBottomNav({ Leaderboard , - Rivals & Challenges + Rivals , - Goals & Milestones + Targets , ]; diff --git a/client/src/components/user/UGPTStatsOverview.tsx b/client/src/components/user/UGPTStatsOverview.tsx index d973fa2e7..bec105c0f 100644 --- a/client/src/components/user/UGPTStatsOverview.tsx +++ b/client/src/components/user/UGPTStatsOverview.tsx @@ -3,7 +3,6 @@ import ClassBadge from "components/game/ClassBadge"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import MiniTable from "components/tables/components/MiniTable"; import Divider from "components/util/Divider"; -import Icon from "components/util/Icon"; import React from "react"; import { GetGamePTConfig,