Skip to content

Commit d08e422

Browse files
committed
Merge branch 'dev' into feat/write#19
2 parents c378ff4 + 9c64186 commit d08e422

31 files changed

+784
-777
lines changed

public/1Stars.png

28.5 KB
Loading

public/2Stars.png

30.8 KB
Loading

src/domains/mypage/components/DeleteAllModal.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import ConfirmModal from '@/shared/components/modal-pop/ConfirmModal';
22
import { Dispatch, SetStateAction } from 'react';
33
import useFetchMyBar from '../api/fetchMyBar';
44
import useFetchAlarm from '../api/fetchAlarm';
5+
import { useToast } from '@/shared/hook/useToast';
56

67
interface Props {
78
open: boolean;
@@ -11,16 +12,23 @@ interface Props {
1112
}
1213

1314
function DeleteAllModal({ open, onClose, setIsModal, type }: Props) {
15+
const { toastSuccess } = useToast();
1416
const { deleteMyBar } = useFetchMyBar();
1517
const { deleteAlarm } = useFetchAlarm();
1618
const handleBarDelete = () => {
1719
deleteMyBar.mutate(undefined, {
18-
onSuccess: () => setIsModal(false),
20+
onSuccess: () => {
21+
toastSuccess('성공적으로 삭제 되었습니다.');
22+
setIsModal(false);
23+
},
1924
});
2025
};
2126
const handleAlarmDelete = () => {
2227
deleteAlarm.mutate(undefined, {
23-
onSuccess: () => setIsModal(false),
28+
onSuccess: () => {
29+
setIsModal(false);
30+
toastSuccess('성공적으로 삭제 되었습니다.');
31+
},
2432
});
2533
};
2634

src/domains/mypage/components/EditNickName.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function EditNickName({
8080
value={editNickName}
8181
className="w-full"
8282
/>
83-
<TextButton onClick={handleDefaultNickname}>전 닉네임으로 돌아가기</TextButton>
83+
<TextButton onClick={handleDefaultNickname}>초기화</TextButton>
8484
</div>
8585
</ModalLayout>
8686
);

src/domains/mypage/components/pages/my-alarm/MyAlarm.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Link from 'next/link';
77
import useFetchAlarm from '@/domains/mypage/api/fetchAlarm';
88
import { useQuery } from '@tanstack/react-query';
99
import DeleteAllModal from '../../DeleteAllModal';
10+
import { useToast } from '@/shared/hook/useToast';
1011

1112
interface MyAlarm {
1213
createdAt: Date;
@@ -21,6 +22,7 @@ interface MyAlarm {
2122
}
2223

2324
function MyAlarm() {
25+
const { toastInfo } = useToast();
2426
const [isModal, setIsModal] = useState(false);
2527
const { fetchAlarm } = useFetchAlarm();
2628
const { data } = useQuery({
@@ -29,6 +31,10 @@ function MyAlarm() {
2931
});
3032

3133
const handleDelete = () => {
34+
if (data.items.length == 0) {
35+
toastInfo('아직 알림이 없습니다.');
36+
return;
37+
}
3238
setIsModal(!isModal);
3339
};
3440

src/domains/mypage/components/pages/my-bar/MyBar.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useState } from 'react';
88
import DeleteAllModal from '../../DeleteAllModal';
99
import useFetchMyBar from '@/domains/mypage/api/fetchMyBar';
1010
import { useQuery } from '@tanstack/react-query';
11+
import { useToast } from '@/shared/hook/useToast';
1112

1213
interface MyCocktail {
1314
cocktailId: number;
@@ -19,6 +20,7 @@ interface MyCocktail {
1920
}
2021

2122
function MyBar() {
23+
const { toastInfo } = useToast();
2224
const [isModal, setIsModal] = useState(false);
2325
const { fetchMyBar } = useFetchMyBar();
2426
const { data } = useQuery({
@@ -28,6 +30,10 @@ function MyBar() {
2830
});
2931

3032
const handleDelete = () => {
33+
if (data.items.length == 0) {
34+
toastInfo('저장한 칵테일이 없습니다.');
35+
return;
36+
}
3137
setIsModal(!isModal);
3238
};
3339

src/domains/recipe/api/CocktailSearch.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/domains/recipe/api/RecipeFetch.tsx

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)