Skip to content

Commit 6c1e79b

Browse files
authored
Merge pull request #225 from part3-4team-Taskify/minji
[Fix, Refactor] signup: 중복 이메일 가입 에러 토스트 처리 / InvitedDashboard: 컴포넌트 깜빡임 fix
2 parents 973f017 + d6bf208 commit 6c1e79b

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
lines changed

src/components/gnb/MemberListMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const MemberListMenu: React.FC<MemberListMenuProps> = ({
2424
ref={ref}
2525
className={clsx(
2626
"absolute top-full right-0 w-[140px] sm:w-[190px] z-50",
27-
"bg-white border border-[var(--color-gray3)] shadow",
27+
"bg-white border border-[var(--color-gray3)] rounded-lg shadow",
2828
"transition-all duration-200 ease-out",
2929
isListOpen
3030
? "opacity-100 translate-y-0"

src/components/gnb/UserMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const dropdownButtonStyles = clsx(
1616
"flex justify-center md:justify-start items-center",
1717
"w-full px-3 py-3 gap-3",
1818
"text-sm lg:text-base text-black3",
19-
"hover:text-[var(--primary)] hover:bg-[#f9f9f9] cursor-pointer"
19+
"hover:text-[var(--primary)] hover:bg-[var(--color-violet8)] cursor-pointer"
2020
);
2121

2222
const UserMenu: React.FC<UserMenuProps> = ({ isMenuOpen, setIsMenuOpen }) => {
@@ -38,7 +38,7 @@ const UserMenu: React.FC<UserMenuProps> = ({ isMenuOpen, setIsMenuOpen }) => {
3838
ref={ref}
3939
className={clsx(
4040
"absolute top-full right-0 w-full z-50",
41-
"bg-white border border-[var(--color-gray3)] shadow",
41+
"bg-white border border-[var(--color-gray3)] rounded-lg shadow",
4242
"transition-all duration-200 ease-out",
4343
isMenuOpen
4444
? "opacity-100 translate-y-0"

src/components/landing/Section1.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function Section1() {
5050
{/* CTA 버튼들 */}
5151
<div
5252
className="sm:mt-[70px] mt-[45px] flex gap-4 flex-col sm:flex-row
53-
min-w-0 w-full sm:max-w-[380px] max-w-[280px]"
53+
min-w-0 w-full sm:max-w-[420px] max-w-[280px]"
5454
>
5555
<GuestModeButton />
5656
<button
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// 태그 색상 변경용 태그 컬러칩
2+
import clsx from "clsx";
3+
4+
export 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 SelectTagColorChipProps {
24+
selectedColorIndex: number;
25+
setSelectedColorIndex: (index: number) => void;
26+
}
27+
28+
export function SelectTagColorChip({
29+
selectedColorIndex,
30+
setSelectedColorIndex,
31+
}: SelectTagColorChipProps) {
32+
return (
33+
<div className="flex gap-2 mt-2">
34+
{tagColors.map((color, idx) => (
35+
<div
36+
key={idx}
37+
onClick={() => setSelectedColorIndex(idx)}
38+
className={clsx(
39+
"w-5 h-5 rounded-full cursor-pointer transition",
40+
color.bgColor,
41+
selectedColorIndex === idx && "ring-[1.5px] ring-[var(--primary)]"
42+
)}
43+
/>
44+
))}
45+
</div>
46+
);
47+
}

src/components/table/invited/InvitedDashBoard.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ export default function InvitedDashBoard({
198198
agreeInvitation,
199199
}: InvitedDashBoardProps) {
200200
const { user } = useUserStore();
201+
const [isInitialized, setIsInitialized] = useState(false);
202+
201203
const [searchTitle, setSearchTitle] = useState("");
202204
const [invitationData, setInvitationData] = useState<Map<CursorId, Invite[]>>(
203205
new Map()
@@ -264,6 +266,10 @@ export default function InvitedDashBoard({
264266
return newMap;
265267
});
266268

269+
setTimeout(() => {
270+
setIsInitialized(true);
271+
}, 0);
272+
267273
if (newInvitations.length < ITEMS_PER_PAGE) {
268274
setHasMore(false);
269275
}
@@ -291,6 +297,8 @@ export default function InvitedDashBoard({
291297
});
292298
};
293299

300+
if (!isInitialized) return null;
301+
294302
return (
295303
<div>
296304
{invitationArray.length === 0 ? (

src/pages/signup.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Input from "@/components/input/Input";
88
import { Modal } from "@/components/modal/Modal";
99
import { CustomBtn } from "@/components/button/CustomButton";
1010
import { toast } from "react-toastify";
11+
import { AxiosError } from "axios";
1112

1213
export default function SignUpPage() {
1314
const [email, setEmail] = useState("");
@@ -54,8 +55,13 @@ export default function SignUpPage() {
5455
setIsSuccessModalOpen(true);
5556
});
5657
} catch (error) {
57-
console.error("회원가입 실패", error);
58-
toast.error("회원가입에 실패했습니다.");
58+
const AxiosError = error as AxiosError<{ message: string }>;
59+
if (AxiosError.response?.status === 409) {
60+
toast.error("중복된 이메일입니다.");
61+
} else {
62+
console.error("회원가입 실패", error);
63+
toast.error("회원가입에 실패했습니다.");
64+
}
5965
}
6066
};
6167

0 commit comments

Comments
 (0)