diff --git a/api/player/apis.ts b/api/player/apis.ts new file mode 100644 index 0000000..82eafbf --- /dev/null +++ b/api/player/apis.ts @@ -0,0 +1,15 @@ +import { CoachResponse } from "./types"; + +// api/player/coachlist + +export const getCoachList = async (): Promise => { + const BASE_URL = process.env.NEXT_PUBLIC_API_KEY; + const res = await fetch(`${BASE_URL}/player/coachlist`, { method: "GET" }); + + if (!res.ok) { + throw new Error("Failed to fetch coach list"); + } + + const response: CoachResponse = await res.json(); + return response.data.list; // list 반환 +}; diff --git a/api/player/types.ts b/api/player/types.ts new file mode 100644 index 0000000..21be803 --- /dev/null +++ b/api/player/types.ts @@ -0,0 +1,5 @@ +export type CoachResponse = { + data: { + list: CoachInfo[]; + }; +}; diff --git a/app/(menu)/player/coach/[id]/page.tsx b/app/(menu)/player/coach/[id]/page.tsx new file mode 100644 index 0000000..0d94edf --- /dev/null +++ b/app/(menu)/player/coach/[id]/page.tsx @@ -0,0 +1,10 @@ +import { CoachDetail } from "@/components/player/coach-detail"; + +export default async function Page() { + return ( + <> +
코치 디테일 페이지
+ + + ); +} diff --git a/app/(menu)/player/coach/page.tsx b/app/(menu)/player/coach/page.tsx index 974c7c3..a9f334e 100644 --- a/app/(menu)/player/coach/page.tsx +++ b/app/(menu)/player/coach/page.tsx @@ -1,3 +1,10 @@ -export default function page() { - return
page입니다
; +import { CoachList } from "@/components/player/coach-list"; +export const dynamic = "force-dynamic"; +export default async function Page() { + return ( + <> + {/* @ts-expect-error - Async Server Component need to be supported */} + + + ); } diff --git a/components/layout/header.tsx b/components/layout/header.tsx index 693aa33..b2a23fc 100644 --- a/components/layout/header.tsx +++ b/components/layout/header.tsx @@ -1,6 +1,6 @@ "use client"; -import wizLogo from "@/assets/images/logo_ktwiz_en.svg"; +import { ktwiz_en } from "@/assets/images/@index"; import Image from "next/image"; import { MainMenuItems } from "@/constants/header-menu"; import HeaderRightMenu from "./headerRightMenu"; @@ -41,10 +41,10 @@ const Header = () => {
{/* 로고 */} wiz_logo router.push("/")} /> diff --git a/components/layout/headerRightMenu.tsx b/components/layout/headerRightMenu.tsx index ca0c2aa..d3d8f94 100644 --- a/components/layout/headerRightMenu.tsx +++ b/components/layout/headerRightMenu.tsx @@ -1,6 +1,6 @@ import Image from "next/image"; import Link from "next/link"; -import ktSportsLogo from "@/assets/images/logo_ktsports.png"; +import { logo_ktwports } from "@/assets/images/@index"; const HeaderRightMenu = () => { return ( @@ -13,7 +13,12 @@ const HeaderRightMenu = () => { 회원가입 - kt_sports_logo + kt_sports_logo
); diff --git a/components/player/coach-card.tsx b/components/player/coach-card.tsx new file mode 100644 index 0000000..d7dfbaa --- /dev/null +++ b/components/player/coach-card.tsx @@ -0,0 +1,24 @@ +import Image from "next/image"; + +const CoachCard = ({ image, name, backnum }: CoachCardProps) => { + return ( +
+
+ {`${name}_image`} +
+
+

{name}

+

No. {backnum}

+
+
+ ); +}; + +export default CoachCard; diff --git a/components/player/coach-detail.tsx b/components/player/coach-detail.tsx new file mode 100644 index 0000000..98531a5 --- /dev/null +++ b/components/player/coach-detail.tsx @@ -0,0 +1,24 @@ +import Image from "next/image"; +import { player } from "@/assets/images/@index"; + +export const CoachDetail = () => { + return ( + <> +
+
+
+ player_image +
+
+
+ NO.1 코칭스텝 +
+
김주일
+
KIM JOO IL
+

+
+
+
+ + ); +}; diff --git a/components/player/coach-list.tsx b/components/player/coach-list.tsx new file mode 100644 index 0000000..5f6870c --- /dev/null +++ b/components/player/coach-list.tsx @@ -0,0 +1,21 @@ +import { getCoachList } from "@/api/player/apis"; +import CoachCard from "./coach-card"; + +export async function CoachList() { + const coachList = await getCoachList(); + + return ( +
+ {coachList.map((coach) => ( + + ))} +
+ ); +} + +export default CoachList; diff --git a/components/player/type.d.ts b/components/player/type.d.ts new file mode 100644 index 0000000..89196ad --- /dev/null +++ b/components/player/type.d.ts @@ -0,0 +1,26 @@ +type CoachCardProps = { + image: string; + name: string; + backnum: number; +}; +type CoachInfo = { + backnum: string; + birth: string; + career: string; + gyear: string; + height: string; + heightWeight: string; + hittype: string; + mobilePlayerImg1: string; + mobilePlayerImg2: string; + orderSeq: string; + pcode: string; + playerName: string; + playerPrvwImg: string; + playerPrvwImg2: string; + playerPrvwImg3: string; + position: string; + teamCode: string; + teamName: string; + weight: string; +}; diff --git a/css/font.ts b/css/font.ts index 91c34d0..f2b3c12 100644 --- a/css/font.ts +++ b/css/font.ts @@ -1,7 +1,8 @@ export const FONT_SIZE = { - s: '12px', - m: '14px', - l: '17px', - xl: '20px', - xxl: '48px', + s: "12px", + m: "14px", + l: "17px", + xl: "20px", + xll: "24px", + xxl: "48px", };