Skip to content

Commit 7e5fab6

Browse files
committed
feat: 배경 등록 버그 수정
1 parent ab2fd1d commit 7e5fab6

File tree

9 files changed

+47
-39
lines changed

9 files changed

+47
-39
lines changed

next.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const nextConfig: NextConfig = {
1919
],
2020
},
2121
/* config options here */
22-
api: {
23-
bodyParser: {
24-
sizeLimit: "10mb", // 기본값 1mb에서 10mb로 증가
22+
experimental: {
23+
serverActions: {
24+
bodySizeLimit: "10mb",
2525
},
2626
},
2727
webpack: (config) => {

src/(actions)/builder/page/page.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ export const updatePageCall = async (
5656
if (backgroundImage) {
5757
formData.append("image", backgroundImage);
5858
}
59-
await fetchIncetance(
59+
const res = await fetchIncetance(
6060
`${process.env.NEXT_PUBLIC_BACKEND_API}${update.path(gameId, pageId)}`,
6161
{
6262
method: update.METADATA.method,
63-
// headers: {
64-
// "Content-Type": "multipart/form-data",
65-
// },
6663
body: formData,
6764
}
6865
);
66+
return await res.json();
6967
};
7068

7169
export const getAllGameCall = async (

src/(actions)/fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export const fetchIncetance = async (url: string, options: RequestInit) => {
1313
...options.headers,
1414
},
1515
});
16+
1617
if (!response.ok) {
1718
const error: {
1819
message: string;
1920
statusCode: number;
2021
} = (await response.json()).message;
21-
2222
throw new Error(error.message);
2323
}
2424

src/app/(builder)/builder/game/(page)/[gameId]/page/[pageId]/page.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ export default function BuilderGamePage() {
359359
alt="background"
360360
fill
361361
style={{ objectFit: "cover" }}
362+
onClick={(e) => {
363+
if (e.target !== e.currentTarget) return;
364+
365+
setActiveBlock(null);
366+
}}
362367
/>
363368
</div>
364369
</div>
@@ -442,7 +447,10 @@ export default function BuilderGamePage() {
442447
))}
443448
</div>
444449
{/* 선택지 */}
445-
<div id="choice-container" className="flex flex-col gap-2">
450+
<div
451+
id="choice-container"
452+
className="flex flex-col gap-2 mt-2 ml-[20px] mr-[20px]"
453+
>
446454
{page?.choices.map((choice, idx) => {
447455
const isActive =
448456
activeBlock?.idx === idx && activeBlock?.type === "choice";

src/app/(main)/main/builder/new-game/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@ import React from "react";
44
import MarginWrapper from "../../_component/MarginWrapper";
55

66
export default function Layout({ children }: { children: React.ReactNode }) {
7-
return (
8-
<MarginWrapper>
9-
<div className="flex flex-col w-full">{children}</div>
10-
</MarginWrapper>
11-
);
7+
return <div className="flex flex-col w-full">{children}</div>;
128
}

src/app/(main)/main/game/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import MarginWrapper from "../_component/MarginWrapper";
88
import W600Wrapper from "../_component/W600Wrapper";
99

1010
export default async function GamePage() {
11+
console.log("렌더링");
1112
return (
1213
<div className="flex flex-col w-full items-center">
1314
<MarginWrapper>

src/app/(main)/main/my/_components/ContinuedGames.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ export default function ContinuedGames() {
4242
</Link>
4343
)}
4444
</div>
45-
<div className="flex flex-row h-[244px] gap-2 flex-nowrap overflow-x-auto overflow-y-hidden mt-[12px]">
45+
<div className="flex flex-row gap-2 flex-nowrap overflow-x-auto overflow-y-hidden mt-[12px]">
4646
{continuedGameList.length === 0 ? (
4747
<div className="flex text-gray-400 body-sb w-full h-full justify-center items-center ">
4848
진행중인 게임이 없어요
4949
</div>
5050
) : (
5151
continuedGameList.map((game) => (
5252
<div
53-
className="flex min-w-[170px] w-[170px] h-[173px] "
53+
className="flex min-w-[170px] w-[170px] "
5454
key={game.game.id.toString()}
5555
>
5656
<ContinuedGamesCard game={game} />

src/app/(main)/main/my/_components/ContinuedGames/Card.tsx

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,36 @@ export default function ContinuedGamesCard({ game }: { game: any }) {
1919
setIsOpen(false);
2020
};
2121
return (
22-
<div className="w-full h-full flex flex-col" onClick={handleClick}>
22+
<>
2323
{isOpen && (
2424
<GameBottomSheet gameId={game.game.id} handleClose={handleClose} />
2525
)}
26-
<>
27-
<Image
28-
className="w-full aspect-square object-cover rounded-[8px]"
29-
src={game.game.thumbnail.url ?? ""}
30-
alt="game"
31-
layout="responsive"
32-
width={100}
33-
height={100}
34-
/>
35-
</>
26+
<div className="w-full h-full flex flex-col" onClick={handleClick}>
27+
<>
28+
<Image
29+
className="w-full aspect-square object-cover rounded-[8px]"
30+
src={game.game.thumbnail.url ?? ""}
31+
alt="game"
32+
layout="responsive"
33+
width={100}
34+
height={100}
35+
/>
36+
</>
3637

37-
<div className="flex flex-col mt-[8px]">
38-
<span className="caption-rg text-gray-100 mt-[8px]">
39-
{convertDate(game.play.createdAt)}
40-
</span>
41-
<div className="headline-md text-white mt-[2px]">{game.game.title}</div>
42-
<div className="flex flex-row items-center mt-[2px]">
43-
<div className="caption-rg text-green-500 line-clamp-1 mt-[2px]">
44-
{game.play.page.title}
38+
<div className="flex flex-col mt-[8px]">
39+
<span className="caption-rg text-gray-100 mt-[8px]">
40+
{convertDate(game.play.createdAt)}
41+
</span>
42+
<div className="headline-md text-white mt-[2px] line-clamp-1">
43+
{game.game.title}
44+
</div>
45+
<div className="flex flex-row items-center mt-[2px]">
46+
<div className="caption-rg text-green-500 line-clamp-1 mt-[2px]">
47+
{game.play.page.title}
48+
</div>
4549
</div>
4650
</div>
4751
</div>
48-
</div>
52+
</>
4953
);
5054
}

src/common/Game/RowCardList/RowCardList.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ export default function RowCardList({
2121
{gameListEntity.gameList.map((card, idx) => {
2222
return (
2323
<div
24-
className={`flex ${
25-
idx === 0 ? "ml-[20px]" : ""
26-
} min-w-[171px] w-[171px] `}
24+
className={`flex ${idx === 0 ? "ml-[20px]" : ""} ${
25+
idx === gameListEntity.gameList.length - 1 ? "mr-[20px]" : ""
26+
}
27+
min-w-[171px] w-[171px] `}
2728
key={card.game.id}
2829
>
2930
<Card

0 commit comments

Comments
 (0)