Skip to content

Commit e1de0f5

Browse files
authored
Merge pull request #121 from part3-4team-Taskify/Newfeat01
[Style] mydashboard CSS디자인 변경
2 parents be4a800 + 9477fb0 commit e1de0f5

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
lines changed

src/components/button/PaginationButton.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ export const PaginationButton: React.FC<PaginationButtonProps> = ({
1212
...props
1313
}) => {
1414
const baseStyle =
15-
"w-[40px] h-[40px] flex justify-center items-center border border-[var(--color-gray3)] rounded-md text-[16px] font-medium cursor-pointer transition";
15+
"w-[40px] h-[40px] flex justify-center items-center border border-[var(--color-gray3)] rounded-md text-[16px] font-medium transition";
1616

1717
const enabledTextColor =
18-
"text-[var(--color-gray1)] bg-white hover:bg-[var(--color-gray5)]";
19-
const disabledTextColor = "text-[var(--color-gray3)] ";
20-
18+
"text-[var(--color-gray1)] bg-white hover:bg-[var(--color-gray5)] cursor-pointer";
19+
const disabledTextColor = "text-[var(--color-gray3)] cursor-default";
2120
const finalStyle = `${baseStyle} ${disabled ? disabledTextColor : enabledTextColor}`;
2221

2322
return (

src/components/modalInput/ModalInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import moment from "moment";
21
import Image from "next/image";
32
import { ChangeEvent, useState, KeyboardEvent, useEffect } from "react";
43
import DatePicker from "react-datepicker";

src/components/sideMenu/SideMenu.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ export default function SideMenu({
131131
</div>
132132
</div>
133133

134-
{/* 메뉴 전체 */}
135134
<nav className="flex flex-col flex-1 justify-between">
136135
<div>
137-
{/* 대시보드 타이틀 */}
138136
{!isCollapsed && (
139137
<div className="mb-4 flex items-center justify-between px-3 md:px-2">
140138
<span className="hidden md:block font-12sb text-[var(--color-black)]">

src/pages/mydashboard.tsx

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface Dashboard {
2626
}
2727

2828
export default function MyDashboardPage() {
29-
const { user, isInitialized } = useAuthGuard(); // 미인증 접근 시 로그인 페이지 이동
29+
const { user, isInitialized } = useAuthGuard();
3030
const teamId = "13-4";
3131
const [dashboardList, setDashboardList] = useState<Dashboard[]>([]);
3232
const [currentPage, setCurrentPage] = useState(1);
@@ -58,13 +58,13 @@ export default function MyDashboardPage() {
5858
createdByMe={dashboard.createdByMe}
5959
onDeleteClick={(id) => {
6060
setSelectedDashboardId(id);
61-
setSelectedCreatedByMe(true); // 내가 만든 대시보드일 때는 삭제
61+
setSelectedCreatedByMe(true);
6262
setSelectedTitle(dashboard.title);
6363
setIsDeleteModalOpen(true);
6464
}}
6565
onLeaveClick={(id) => {
6666
setSelectedDashboardId(id);
67-
setSelectedCreatedByMe(false); // 내가 만든 대시보드 아닐 때는 탈퇴
67+
setSelectedCreatedByMe(false);
6868
setSelectedTitle(dashboard.title);
6969
setIsDeleteModalOpen(true);
7070
}}
@@ -80,7 +80,7 @@ export default function MyDashboardPage() {
8080
console.error("대시보드 불러오기 실패:", error);
8181
}
8282
};
83-
// 유저 정보 복원된 상태 & 로그인 상태일 때만 api 호출 실행
83+
8484
useEffect(() => {
8585
if (isInitialized && user) {
8686
fetchDashboards();
@@ -95,23 +95,21 @@ export default function MyDashboardPage() {
9595
if (currentPage < totalPages) setCurrentPage((prev) => prev + 1);
9696
};
9797

98-
//대시보드 삭제
9998
const handleDelete = async () => {
10099
if (!selectedDashboardId) return;
101100
try {
102101
await axiosInstance.delete(
103102
apiRoutes.DashboardDetail(selectedDashboardId)
104103
);
105104
setIsDeleteModalOpen(false);
106-
setSelectedDashboardId(null); // 선택 초기화
107-
fetchDashboards(); // 목록 갱신
105+
setSelectedDashboardId(null);
106+
fetchDashboards();
108107
} catch (error) {
109108
alert("대시보드 삭제에 실패했습니다.");
110109
console.error("삭제 실패:", error);
111110
}
112111
};
113112

114-
// 대시보드 탈퇴(백엔드 설정 없음, 로컬에서만 제거)
115113
const handleLeave = () => {
116114
if (!selectedDashboardId) return;
117115
setDashboardList((prev) =>
@@ -137,22 +135,23 @@ export default function MyDashboardPage() {
137135
/>
138136

139137
<main className="flex-1 overflow-auto px-[25px] pt-[40px] pb-10 bg-[#f9f9f9] space-y-10">
140-
{/* 대시보드 카드 + 페이지네이션 */}
141-
<section className="flex flex-col items-start space-y-6">
142-
<div className="flex flex-wrap gap-x-[20px] gap-y-[16px] w-full max-w-[1100px]">
138+
<section className="w-full max-w-[1100px] mx-auto">
139+
{/* 카드 영역 */}
140+
<div className="flex flex-wrap gap-[16px] justify-center">
143141
{currentItems}
144142
</div>
145143

144+
{/* 페이지네이션 */}
146145
{totalPages > 1 && (
147-
<div className="justify-end flex items-center w-full max-w-[1035px]">
148-
<span className="font-14r text-black3 pr-[16px]">
149-
{`${totalPages}페이지 중 ${currentPage}`}
150-
</span>
146+
<div className="flex justify-center items-center pt-6">
151147
<PaginationButton
152148
direction="left"
153149
disabled={currentPage === 1}
154150
onClick={handlePrevPage}
155151
/>
152+
<span className="font-14r text-black3 px-[8px] whitespace-nowrap">
153+
{`${totalPages} 페이지 중 ${currentPage}`}
154+
</span>
156155
<PaginationButton
157156
direction="right"
158157
disabled={currentPage === totalPages}
@@ -162,23 +161,22 @@ export default function MyDashboardPage() {
162161
)}
163162
</section>
164163

165-
<div className="mt-[74px] flex justify-start">
164+
{/* 초대받은 대시보드 */}
165+
<div className="mt-[74px] flex justify-center">
166166
<InvitedDashBoard />
167167
</div>
168168
</main>
169169
</div>
170170

171-
{/* 새로운 대시보드 모달 */}
172171
{isModalOpen && (
173172
<NewDashboard
174173
onClose={() => {
175174
setIsModalOpen(false);
176-
fetchDashboards(); // 생성 후 목록 새로고침
175+
fetchDashboards();
177176
}}
178177
/>
179178
)}
180179

181-
{/*대시보드 삭제 모달*/}
182180
<Modal
183181
width="w-[260px]"
184182
height="h-[150px]"
@@ -196,6 +194,12 @@ export default function MyDashboardPage() {
196194
</div>
197195
</div>
198196
<div className="flex items-center justify-center gap-2">
197+
<CustomBtn
198+
onClick={() => setIsDeleteModalOpen(false)}
199+
className="cursor-pointer border px-3 py-1 rounded-md w-[84px] h-[32px] text-[var(--primary)] border-[var(--color-gray3)]"
200+
>
201+
취소
202+
</CustomBtn>
199203
<CustomBtn
200204
onClick={
201205
selectedCreatedByMe ? () => handleDelete() : () => handleLeave()
@@ -204,12 +208,6 @@ export default function MyDashboardPage() {
204208
>
205209
확인
206210
</CustomBtn>
207-
<CustomBtn
208-
onClick={() => setIsDeleteModalOpen(false)}
209-
className="cursor-pointer border px-3 py-1 rounded-md w-[84px] h-[32px] text-[var(--primary)] border-[var(--color-gray3)]"
210-
>
211-
취소
212-
</CustomBtn>
213211
</div>
214212
</Modal>
215213
</div>

0 commit comments

Comments
 (0)