From f03ac7809d6fb690288cc17407257355dcb4e894 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 22 Oct 2023 03:47:22 +0100 Subject: [PATCH] more cleanup and added hover labels to player labels --- src/app/player/[id]/page.tsx | 4 ++-- src/app/search/page.tsx | 2 +- src/components/Label.tsx | 10 +++++++++- src/components/{ => player}/PlayerChart.tsx | 0 src/components/{ => player}/PlayerInfo.tsx | 13 +++++++++---- src/components/{ => player}/Score.tsx | 0 src/components/{ => player}/ScoreStatLabel.tsx | 7 ++++++- src/components/{ => player}/Scores.tsx | 6 +++--- src/components/{ => player}/SearchPlayer.tsx | 2 +- 9 files changed, 31 insertions(+), 13 deletions(-) rename src/components/{ => player}/PlayerChart.tsx (100%) rename src/components/{ => player}/PlayerInfo.tsx (92%) rename src/components/{ => player}/Score.tsx (100%) rename src/components/{ => player}/ScoreStatLabel.tsx (81%) rename src/components/{ => player}/Scores.tsx (97%) rename src/components/{ => player}/SearchPlayer.tsx (98%) diff --git a/src/app/player/[id]/page.tsx b/src/app/player/[id]/page.tsx index 2c2cdbf..59410c9 100644 --- a/src/app/player/[id]/page.tsx +++ b/src/app/player/[id]/page.tsx @@ -3,9 +3,9 @@ import Card from "@/components/Card"; import Container from "@/components/Container"; import Error from "@/components/Error"; -import PlayerInfo from "@/components/PlayerInfo"; -import Scores from "@/components/Scores"; import { Spinner } from "@/components/Spinner"; +import PlayerInfo from "@/components/player/PlayerInfo"; +import Scores from "@/components/player/Scores"; import { ScoresaberPlayer } from "@/schemas/scoresaber/player"; import { useSettingsStore } from "@/store/settingsStore"; import { SortType, SortTypes } from "@/types/SortTypes"; diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 4d42868..17f32c6 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -2,7 +2,7 @@ import Avatar from "@/components/Avatar"; import Card from "@/components/Card"; import Container from "@/components/Container"; -import SearchPlayer from "@/components/SearchPlayer"; +import SearchPlayer from "@/components/player/SearchPlayer"; import { Metadata } from "next"; export const metadata: Metadata = { diff --git a/src/components/Label.tsx b/src/components/Label.tsx index 2b1a888..cfefc8c 100644 --- a/src/components/Label.tsx +++ b/src/components/Label.tsx @@ -3,16 +3,24 @@ import clsx from "clsx"; type LabelProps = { title: string; value: any; + hoverValue?: string; className?: string; }; export default function Label({ title, value, + hoverValue, className = "bg-neutral-700", }: LabelProps) { return ( -
+

{title}

diff --git a/src/components/PlayerChart.tsx b/src/components/player/PlayerChart.tsx similarity index 100% rename from src/components/PlayerChart.tsx rename to src/components/player/PlayerChart.tsx diff --git a/src/components/PlayerInfo.tsx b/src/components/player/PlayerInfo.tsx similarity index 92% rename from src/components/PlayerInfo.tsx rename to src/components/player/PlayerInfo.tsx index 7f47a56..ad441dc 100644 --- a/src/components/PlayerInfo.tsx +++ b/src/components/player/PlayerInfo.tsx @@ -8,9 +8,9 @@ import { useRef } from "react"; import ReactCountryFlag from "react-country-flag"; import { toast } from "react-toastify"; import { useStore } from "zustand"; -import Avatar from "./Avatar"; -import Card from "./Card"; -import Label from "./Label"; +import Avatar from "../Avatar"; +import Card from "../Card"; +import Label from "../Label"; import PlayerChart from "./PlayerChart"; type PlayerInfoProps = { @@ -119,16 +119,19 @@ export default function PlayerInfo({ playerData }: PlayerInfoProps) {