Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

➕ [WV-35] : feat player coach page 생성 #38

Merged
merged 20 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1921dd6
🔧 WV-35 fix : image 에러및 warning 수정
hayoung78 Jan 5, 2025
3ee6d71
🔥 WV-35 remove : 불필요한 코드 삭제
hayoung78 Jan 5, 2025
9c25a41
🔧 WV-35 fix : image 경고 수정
hayoung78 Jan 5, 2025
d5abbe6
➕ WV-35 feat : getCoachlist api 함수 생성
hayoung78 Jan 6, 2025
ab51b2b
➕ WV-35 feat : coachstep 페이지 생성
hayoung78 Jan 6, 2025
c22059a
🔥 WV-35 remove : 불필요한 코드 삭제
hayoung78 Jan 6, 2025
87dff3f
🔥 WV-35 remove : 불필요한 코드 삭제
hayoung78 Jan 6, 2025
09054ae
🔥 WV-35 remove : 불필요한 코드 삭제
hayoung78 Jan 6, 2025
bfbd12f
🔥 WV-35 remove : 불필요한 코드 삭제
hayoung78 Jan 6, 2025
8efb6b8
♻️ WV-35 refactor: .env파일 수정 및 BASE_URL수정
hayoung78 Jan 6, 2025
4696b96
♻️ WV-35 refactor: .env파일 수정 및 BASE_URL수정
hayoung78 Jan 6, 2025
9a314c3
♻️ WV-35 refactor: .env파일 수정 및 BASE_URL수정
hayoung78 Jan 6, 2025
e7a5247
♻️ WV-35 refactor: .env파일 수정 및 BASE_URL수정
hayoung78 Jan 6, 2025
d3cfb2a
♻️ WV-35 refactor: .env파일 수정 및 BASE_URL수정
hayoung78 Jan 6, 2025
d5bd1d0
♻️ WV-35 refactor : 환경변수 수정
hayoung78 Jan 6, 2025
f7a81a8
♻️ WV-35 refactor : 환경변수 수정
hayoung78 Jan 6, 2025
0ce3920
♻️ WV-35 refactor : 환경변수 수정
hayoung78 Jan 6, 2025
34e6c18
Merge branch 'dev' of https://github.com/KTwizviz/wizviz into WV-35-c…
hayoung78 Jan 6, 2025
2acfc79
Merge branch 'dev' of https://github.com/KTwizviz/wizviz into WV-35-c…
hayoung78 Jan 6, 2025
05a05e2
Merge branch 'dev' of https://github.com/KTwizviz/wizviz into WV-35-c…
hayoung78 Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api/player/apis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { CoachResponse } from "./types";

// api/player/coachlist

export const getCoachList = async (): Promise<CoachInfo[]> => {
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 반환
};
5 changes: 5 additions & 0 deletions api/player/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type CoachResponse = {
data: {
list: CoachInfo[];
};
};
7 changes: 7 additions & 0 deletions app/(menu)/player/coach/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default async function Page() {
return (
<>
<div>코치 디테일 페이지</div>
</>
);
}
11 changes: 9 additions & 2 deletions app/(menu)/player/coach/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export default function page() {
return <div>page입니다</div>;
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 */}
<CoachList />
</>
);
}
1 change: 0 additions & 1 deletion components/common/CategoryMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type CategoryMenu = {
const CategoryMenu = () => {
// const router = useRouter();
const pathname = usePathname();
console.log(pathname, "나 패스네임");

const findBannerInfoByPath = () => {
for (const menuKey in SubMenuInfo) {
Expand Down
8 changes: 4 additions & 4 deletions components/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -41,10 +41,10 @@ const Header = () => {
<div className="flex items-center justify-between h-20">
{/* 로고 */}
<Image
src={wizLogo}
src={ktwiz_en}
alt="wiz_logo"
width={90}
height={90}
width={89}
height={42}
className="cursor-pointer"
onClick={() => router.push("/")}
/>
Expand Down
9 changes: 7 additions & 2 deletions components/layout/headerRightMenu.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -13,7 +13,12 @@ const HeaderRightMenu = () => {
회원가입
</Link>
<Link href="/sports" className="border border-ELSE-D9 p-1">
<Image src={ktSportsLogo} alt="kt_sports_logo" width={50} height={50} />
<Image
src={logo_ktwports}
alt="kt_sports_logo"
width={64}
height={17}
/>
</Link>
</div>
);
Expand Down
24 changes: 24 additions & 0 deletions components/player/coach-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Image from "next/image";

const CoachCard = ({ image, name, backnum }: CoachCardProps) => {
return (
<div className="rounded-lg shadow-md overflow-hidden">
<div className="relative w-full h-48">
<Image
src={image}
alt={`${name}_image`}
fill
className="object-cover"
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
priority
/>
</div>
<div className="p-4">
<h3 className="text-l font-bold">{name}</h3>
<p className="text-SYSTEM-main">No. {backnum}</p>
</div>
</div>
);
};

export default CoachCard;
21 changes: 21 additions & 0 deletions components/player/coach-list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { getCoachList } from "@/api/player/apis";
import CoachCard from "./coach-card";

export async function CoachList() {
const coachList = await getCoachList();

return (
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
{coachList.map((coach) => (
<CoachCard
key={coach.backnum}
image={coach.mobilePlayerImg1}
name={coach.playerName}
backnum={parseInt(coach.backnum)}
/>
))}
</div>
);
}

export default CoachList;
26 changes: 26 additions & 0 deletions components/player/type.d.ts
Original file line number Diff line number Diff line change
@@ -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;
};
11 changes: 6 additions & 5 deletions css/font.ts
Original file line number Diff line number Diff line change
@@ -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",
};
15 changes: 14 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "wizzap.ktwiz.co.kr",
},
{
protocol: "http",
hostname: "54.180.228.165",
},
],
},
};

export default nextConfig;
Loading