Skip to content

Commit fd9aff3

Browse files
authored
Merge pull request #148 from part3-4team-Taskify/vercel03
[Fix] 버셀 오류 수정
2 parents 41b7537 + 2af7e7b commit fd9aff3

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

src/components/modal/NewDashboard.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useState } from "react";
22
import Input from "../input/Input";
33
import Image from "next/image";
44
import axios from "axios";
5-
import { TEAM_ID } from "@/constants/team";
65

76
interface Dashboard {
87
id: number;
@@ -14,13 +13,17 @@ interface Dashboard {
1413
createdByMe: boolean;
1514
}
1615

16+
interface NewDashboardProps {
17+
teamId: string;
18+
onClose?: () => void;
19+
onCreate?: (newDashboard: Dashboard) => void;
20+
}
21+
1722
export default function NewDashboard({
23+
teamId,
1824
onClose,
1925
onCreate,
20-
}: {
21-
onClose?: () => void;
22-
onCreate?: (newDashboard: Dashboard) => void;
23-
}) {
26+
}: NewDashboardProps) {
2427
const [title, setTitle] = useState("");
2528
const [selected, setSelected] = useState<number | null>(null);
2629
const [loading, setLoading] = useState(false);
@@ -37,7 +40,7 @@ export default function NewDashboard({
3740
try {
3841
setLoading(true);
3942
const response = await axios.post(
40-
`${process.env.NEXT_PUBLIC_BASE_URL}/${TEAM_ID}/dashboards`,
43+
`${process.env.NEXT_PUBLIC_BASE_URL}/${teamId}/dashboards`,
4144
payload,
4245
{
4346
headers: {

src/components/sideMenu/SideMenu.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ interface SideMenuProps {
2323
}
2424

2525
export default function SideMenu({
26+
teamId,
2627
dashboardList,
2728
onCreateDashboard,
2829
}: SideMenuProps) {
2930
const router = useRouter();
30-
const boardId = router.query.dashboardId?.toString(); // ✅ 여기만 정확히 수정
31+
const boardId = router.query.dashboardId?.toString();
3132

3233
const [currentPage, setCurrentPage] = useState(1);
3334
const [isCollapsed, setIsCollapsed] = useState(false);
@@ -79,10 +80,9 @@ export default function SideMenu({
7980
/>
8081
</Link>
8182

82-
{/* 접기/펼치기 버튼 */}
83+
{/* 접기/펼치기 버튼 (모바일에서는 숨김) */}
8384
<div
8485
className={clsx(
85-
"md:flex",
8686
"hidden sm:flex",
8787
isCollapsed ? "justify-center" : "justify-end",
8888
"w-full"
@@ -181,7 +181,7 @@ export default function SideMenu({
181181
className={clsx(
182182
"w-full flex justify-center md:justify-start p-3 font-18r text-[var(--color-gray1)] transition-colors duration-200",
183183
dashboard.id.toString() === boardId &&
184-
"bg-[var(--color-violet8)] text-[var(--color-gray1)] rounded-sm"
184+
"bg-[var(--color-violet8)] text-[var(--color-black)] font-semibold rounded-l-xl"
185185
)}
186186
>
187187
<Link
@@ -240,6 +240,7 @@ export default function SideMenu({
240240
{/* 모달 */}
241241
{isModalOpen && (
242242
<NewDashboard
243+
teamId={teamId}
243244
onClose={() => setIsModalOpen(false)}
244245
onCreate={(newDashboard) => {
245246
onCreateDashboard?.(newDashboard);

src/pages/mydashboard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,12 @@ export default function MyDashboardPage() {
203203

204204
{isModalOpen && (
205205
<NewDashboard
206+
teamId={TEAM_ID} // ✅ 수정된 부분: teamId 전달
206207
onClose={() => {
207208
setIsModalOpen(false);
208209
fetchDashboards();
209210
}}
211+
onCreate={() => fetchDashboards()}
210212
/>
211213
)}
212214

0 commit comments

Comments
 (0)