From 55c63e5735d268deacbfc09cf3dd633b719f9cd6 Mon Sep 17 00:00:00 2001
From: Yejin <78341274+Yejin0O0@users.noreply.github.com>
Date: Thu, 28 Nov 2024 11:04:02 +0900
Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20=EB=B2=84=ED=8A=BC,=20?=
=?UTF-8?q?=EB=B1=83=EC=A7=80=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?=
=?UTF-8?q?=ED=99=94=20(#265)"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 352f2174a7310f7fac4451c06b8a289e5452811c.
---
components/liveMatch/LeagueStatusButton.tsx | 67 ------------
components/liveMatch/LeagueTierBadge.tsx | 46 ---------
components/pages/LiveMatchList.tsx | 107 ++++++++++++++++++--
3 files changed, 99 insertions(+), 121 deletions(-)
delete mode 100644 components/liveMatch/LeagueStatusButton.tsx
delete mode 100644 components/liveMatch/LeagueTierBadge.tsx
diff --git a/components/liveMatch/LeagueStatusButton.tsx b/components/liveMatch/LeagueStatusButton.tsx
deleted file mode 100644
index a3192f95..00000000
--- a/components/liveMatch/LeagueStatusButton.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { Button } from "@/components/ui/Button";
-import { AccordionTrigger } from "@/components/ui/accordion";
-import type { LeagueStatus } from "@/types/commonTypes";
-import Link from "next/link";
-import React from "react";
-
-interface LeagueStatusButtonProps {
- status: LeagueStatus;
- clubToken: string;
- leagueId: number;
-}
-
-function LeagueStatusButton(props: LeagueStatusButtonProps) {
- const { status, clubToken, leagueId } = props;
-
- if (status === "PLAYING") {
- return (
-
- 진행 상황 보기
-
- );
- }
- if (status === "RECRUITING") {
- return (
-
-
-
- );
- }
-
- if (status === "RECRUITING_COMPLETED") {
- return (
-
-
-
- );
- }
-
- if (status === "CANCELED") {
- return (
-
-
-
- );
- }
-
- if (status === "FINISHED") {
- return (
-
-
-
- );
- }
-}
-
-export default LeagueStatusButton;
diff --git a/components/liveMatch/LeagueTierBadge.tsx b/components/liveMatch/LeagueTierBadge.tsx
deleted file mode 100644
index ee9a0171..00000000
--- a/components/liveMatch/LeagueTierBadge.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import type { Tier } from "@/types/commonTypes";
-import { getTierWithEmojiAndText } from "@/utils/getTier";
-import React from "react";
-import { Badge } from "../ui/badge";
-
-interface LeagueTierBadgeProps {
- tier: Tier;
-}
-
-function LeagueTierBadge(props: LeagueTierBadgeProps) {
- const { tier } = props;
- if (tier === "GOLD") {
- return (
-
- {getTierWithEmojiAndText(tier)}
-
- );
- }
-
- if (tier === "SILVER") {
- return (
-
- {getTierWithEmojiAndText(tier)}
-
- );
- }
-
- if (tier === "BRONZE") {
- return (
-
- {getTierWithEmojiAndText(tier)}
-
- );
- }
-}
-
-export default LeagueTierBadge;
diff --git a/components/pages/LiveMatchList.tsx b/components/pages/LiveMatchList.tsx
index b42d815c..7e549a92 100644
--- a/components/pages/LiveMatchList.tsx
+++ b/components/pages/LiveMatchList.tsx
@@ -17,15 +17,106 @@ import {
useGetMainLeagues,
useGetMainLeaguesMatch,
} from "@/lib/api/hooks/mainLeagueHook";
+import type { LeagueStatus, Tier } from "@/types/commonTypes";
import type {
GetMainLeagues,
GetMainLeaguesMatchData,
} from "@/types/mainLeagueTypes";
+import { getTierWithEmojiAndText } from "@/utils/getTier";
import { format } from "date-fns";
import Link from "next/link";
import React, { useState } from "react";
-import LeagueStatusButton from "../liveMatch/LeagueStatusButton";
-import LeagueTierBadge from "../liveMatch/LeagueTierBadge";
+
+const renderLeagueStatusButton = (
+ status: LeagueStatus,
+ clubToken: string,
+ leagueId: number,
+) => {
+ if (status === "PLAYING") {
+ return (
+
+ 진행 상황 보기
+
+ );
+ }
+ if (status === "RECRUITING") {
+ return (
+
+
+
+ );
+ }
+
+ if (status === "RECRUITING_COMPLETED") {
+ return (
+
+
+
+ );
+ }
+
+ if (status === "CANCELED") {
+ return (
+
+
+
+ );
+ }
+
+ if (status === "FINISHED") {
+ return (
+
+
+
+ );
+ }
+};
+
+const renderLeagueTierBadge = (tier: Tier) => {
+ if (tier === "GOLD") {
+ return (
+
+ {getTierWithEmojiAndText(tier)}
+
+ );
+ }
+
+ if (tier === "SILVER") {
+ return (
+
+ {getTierWithEmojiAndText(tier)}
+
+ );
+ }
+
+ if (tier === "BRONZE") {
+ return (
+
+ {getTierWithEmojiAndText(tier)}
+
+ );
+ }
+};
function LiveMatchList() {
const today = format(new Date(), "yyyy-MM-dd");
@@ -89,7 +180,7 @@ function LiveMatchList() {
-
+ {renderLeagueTierBadge(item.required_tier)}
{item.league_name}
@@ -110,11 +201,11 @@ function LiveMatchList() {
-
+ {renderLeagueStatusButton(
+ item.league_status,
+ item.club_token,
+ item.league_id,
+ )}