Skip to content

Commit 11ca1db

Browse files
authored
Merge pull request #221 from part3-4team-Taskify/minji
[Fix, Style] TaskModal: 분리 전으로 롤백 / Landing: 버튼 너비 반응형 적용 / Card: 컨테이너 높이 반응형 적용
2 parents 0ceef02 + 055ac8e commit 11ca1db

File tree

6 files changed

+87
-21
lines changed

6 files changed

+87
-21
lines changed

src/api/members.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
import axiosInstance from "./axiosInstance";
22
import { apiRoutes } from "./apiRoutes";
3-
4-
// 멤버 타입 정의
5-
export interface Member {
6-
id: number;
7-
userId: number;
8-
email: string;
9-
nickname: string;
10-
profileImageUrl: string | null;
11-
isOwner: boolean;
12-
createdAt?: string;
13-
updatedAt?: string;
14-
}
3+
import { MemberType } from "@/types/users";
154

165
// 🔹 대시보드 멤버 목록 조회
176
export const getMembers = async ({
187
dashboardId,
198
}: {
209
dashboardId: number;
21-
}): Promise<Member[]> => {
10+
}): Promise<MemberType[]> => {
2211
if (!dashboardId) {
2312
console.error("dashboardId가 없습니다.");
2413
return [];
@@ -31,7 +20,7 @@ export const getMembers = async ({
3120
},
3221
});
3322

34-
const members: Member[] = response.data.members || [];
23+
const members: MemberType[] = response.data.members || [];
3524
return members;
3625
} catch (error) {
3726
console.error("getMembers API 실패:", error);

src/components/button/GuestModeButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function GuestModeButton() {
3333
<button
3434
onClick={handleGuestLogin}
3535
className="flex items-center justify-center
36-
sm:w-[220px] w-[280px] h-[54px]
36+
w-full h-[54px]
3737
rounded-lg bg-white cursor-pointer
3838
text-[var(--primary)] font-medium sm:text-[18px] text-[16px]"
3939
>

src/components/columnCard/Card.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export default function Card({
2525
flex flex-col md:flex-row lg:flex-col cursor-pointer
2626
sm:items-center items-start
2727
rounded-md bg-white border border-gray-200 p-4
28-
w-[284px] md:w-[510px] md:h-[93px] lg:w-[314px] lg:h-auto
28+
w-[284px] md:w-[510px]
29+
lg:w-[314px] lg:h-auto min-h-[93px]
2930
`}
3031
>
3132
{/* 이미지 영역 */}
@@ -89,10 +90,10 @@ export default function Card({
8990

9091
{/* 마감일 */}
9192
<div
92-
className="flex items-center justify-between
93-
lg:gap-37 gap-8 sm:pr-4 text-[var(--color-gray1)]"
93+
className="flex items-center justify-between gap-8
94+
w-full text-[var(--color-gray1)]"
9495
>
95-
<div className="flex items-center gap-1">
96+
<div className="flex flex-1 items-center gap-1">
9697
<Image
9798
src="/svgs/calendar.svg"
9899
alt="calendar"

src/components/landing/Section1.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ export default function Section1() {
4848
</span>
4949

5050
{/* CTA 버튼들 */}
51-
<div className="sm:mt-[70px] mt-[45px] flex gap-4 flex-col sm:flex-row">
51+
<div
52+
className="sm:mt-[70px] mt-[45px] flex gap-4 flex-col sm:flex-row
53+
min-w-0 w-full sm:max-w-[220px] max-w-[280px]"
54+
>
5255
<GuestModeButton />
5356
<button
5457
onClick={handleMainClick}
5558
className="flex items-center justify-center
56-
sm:w-[220px] w-[280px] h-[54px]
59+
w-full h-[54px]
5760
rounded-lg bg-[var(--primary)] cursor-pointer
5861
text-[var(--color-white)] font-medium sm:text-[18px] text-[16px]"
5962
>

src/components/modalDashboard/CardDetailModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type { ColumnType } from "@/types/task";
1616

1717
interface CardDetailModalProps {
1818
card: CardDetailType;
19+
currentUserId: number;
1920
dashboardId: number;
2021
createdByMe: boolean;
2122
onClose: () => void;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// 태그 색상 변경용 태그 컬러칩
2+
import clsx from "clsx";
3+
4+
const tagColors = [
5+
{
6+
textColor: "text-[var(--sortTextBlue)]",
7+
bgColor: "bg-[var(--sortTextBgBlue)]",
8+
},
9+
{
10+
textColor: "text-[var(--sortTextPink)]",
11+
bgColor: "bg-[var(--sortTextBgPink)]",
12+
},
13+
{
14+
textColor: "text-[var(--sortTextGreen)]",
15+
bgColor: "bg-[var(--sortTextBgGreen)]",
16+
},
17+
{
18+
textColor: "text-[var(--sortTextOrange)]",
19+
bgColor: "bg-[var(--sortTextBgOrange)]",
20+
},
21+
];
22+
23+
interface Tag {
24+
text: string;
25+
textColor: string;
26+
bgColor: string;
27+
}
28+
29+
interface TagColorChipProps {
30+
tags: Tag[];
31+
selectedTagIndex: number | null;
32+
setTags: (tags: Tag[]) => void;
33+
onValueChange: (newTags: string[]) => void;
34+
}
35+
36+
export function TagColorChip({
37+
tags,
38+
selectedTagIndex,
39+
setTags,
40+
onValueChange,
41+
}: TagColorChipProps) {
42+
return (
43+
<>
44+
{selectedTagIndex !== null && (
45+
<div className="flex gap-2">
46+
{tagColors.map((color, colorIdx) => (
47+
<div
48+
key={colorIdx}
49+
onClick={() => {
50+
const updatedTags = [...tags];
51+
updatedTags[selectedTagIndex] = {
52+
...updatedTags[selectedTagIndex],
53+
textColor: color.textColor,
54+
bgColor: color.bgColor,
55+
};
56+
setTags(updatedTags);
57+
onValueChange(updatedTags.map((tag) => tag.text));
58+
}}
59+
className={clsx(
60+
"w-5 h-5 rounded-full cursor-pointer",
61+
color.bgColor,
62+
selectedTagIndex !== null &&
63+
tags[selectedTagIndex]?.bgColor === color.bgColor &&
64+
"ring-[1.5px] ring-[var(--primary)]"
65+
)}
66+
/>
67+
))}
68+
</div>
69+
)}
70+
</>
71+
);
72+
}

0 commit comments

Comments
 (0)