Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/public/svgs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import IconPostLikeOutline from "./post-like-outline.svg";
import IconScoreBanner from "./score-banner.svg";
import IconSearchBanner from "./search-banner.svg";
import IconSearchFilled from "./search-filled.svg";
import IconShare from "./shareIcon.svg";
import IconShareFilled from "./shareIconFilled.svg";
import IconSignupRegionAmerica from "./signup-region-america.svg";
import IconSignupRegionAsia from "./signup-region-asia.svg";
import IconSignupRegionEurope from "./signup-region-europe.svg";
Expand Down Expand Up @@ -42,6 +44,8 @@ export {
IconScoreBanner,
IconSearchBanner,
IconSearchFilled,
IconShare,
IconShareFilled,
IconSignupRegionAmerica,
IconSignupRegionAsia,
IconSignupRegionEurope,
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/svgs/shareIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions apps/web/public/svgs/shareIconFilled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/web/public/svgs/toast/cap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions apps/web/public/svgs/toast/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import IconToastCap from "./cap.svg";
import IconToastLike from "./like.svg";
import IconToastLink from "./link.svg";
import IconToastLogo from "./logo.svg";
import IconToastUniv from "./univ.svg";

export { IconToastCap, IconToastLike, IconToastLink, IconToastLogo, IconToastUniv };
9 changes: 9 additions & 0 deletions apps/web/public/svgs/toast/like.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/web/public/svgs/toast/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/web/public/svgs/toast/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/web/public/svgs/toast/univ.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/web/src/apis/Auth/postAppleAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query";

import type { AxiosError } from "axios";
import { useRouter } from "next/navigation";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { type AppleAuthRequest, type AppleAuthResponse, authApi } from "./api";

Expand All @@ -20,7 +20,7 @@ const usePostAppleAuth = () => {
// refreshToken은 서버에서 HTTP-only 쿠키로 자동 설정됨
useAuthStore.getState().setAccessToken(data.accessToken);

toast.success("로그인에 성공했습니다.");
showIconToast("logo", "로그인에 성공했습니다.");

setTimeout(() => {
router.push("/");
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/Auth/postEmailLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query";

import type { AxiosError } from "axios";
import { useRouter } from "next/navigation";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { authApi, type EmailLoginRequest, type EmailLoginResponse } from "./api";

Expand All @@ -22,7 +22,7 @@ const usePostEmailAuth = () => {
// refreshToken은 서버에서 HTTP-only 쿠키로 자동 설정됨
setAccessToken(accessToken);

toast.success("로그인에 성공했습니다.");
showIconToast("logo", "로그인에 성공했습니다.");

// Zustand persist middleware가 localStorage에 저장할 시간을 보장
// 토큰 저장 후 리다이렉트하여 타이밍 이슈 방지
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/Auth/postKakaoAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query";

import type { AxiosError } from "axios";
import { useRouter } from "next/navigation";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { authApi, type KakaoAuthRequest, type KakaoAuthResponse } from "./api";

Expand All @@ -21,7 +21,7 @@ const usePostKakaoAuth = () => {
// refreshToken은 서버에서 HTTP-only 쿠키로 자동 설정됨
setAccessToken(data.accessToken);

toast.success("로그인에 성공했습니다.");
showIconToast("logo", "로그인에 성공했습니다.");
setTimeout(() => {
router.push("/");
}, 100);
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/MyPage/patchPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";

import type { AxiosError } from "axios";
import { useRouter } from "next/navigation";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { QueryKeys } from "../queryKeys";
import { myPageApi, type PasswordPatchRequest } from "./api";
Expand All @@ -18,7 +18,7 @@ const usePatchMyPassword = () => {
onSuccess: () => {
clearAccessToken();
queryClient.clear();
toast.success("비밀번호가 성공적으로 변경되었습니다.");
showIconToast("logo", "비밀번호가 성공적으로 변경되었습니다.");
router.replace("/");
},
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/MyPage/patchProfile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import { QueryKeys } from "../queryKeys";
import { myPageApi, type ProfilePatchRequest } from "./api";

Expand All @@ -16,7 +16,7 @@ const usePatchMyInfo = () => {
});
},
onSuccess: () => {
toast.success("프로필이 성공적으로 수정되었습니다.");
showIconToast("logo", "프로필이 성공적으로 수정되었습니다.");
},
});
};
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/Scores/postCreateGpa.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";

import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import { ScoresQueryKeys, scoresApi, type UsePostGpaScoreRequest } from "./api";

/**
Expand All @@ -13,7 +13,7 @@ export const usePostGpaScore = () => {
mutationFn: (request: UsePostGpaScoreRequest) => scoresApi.postGpaScore(request),

onSuccess: () => {
toast.success("학점 정보가 성공적으로 제출되었습니다.");
showIconToast("logo", "학점 정보가 성공적으로 제출되었습니다.");
queryClient.invalidateQueries({ queryKey: [ScoresQueryKeys.myGpaScore] });
},
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/Scores/postCreateLanguageTest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";

import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import { ScoresQueryKeys, scoresApi, type UsePostLanguageTestScoreRequest } from "./api";

/**
Expand All @@ -13,7 +13,7 @@ export const usePostLanguageTestScore = () => {
mutationFn: (request: UsePostLanguageTestScoreRequest) => scoresApi.postLanguageTestScore(request),

onSuccess: () => {
toast.success("어학 성적이 성공적으로 제출되었습니다.");
showIconToast("logo", "어학 성적이 성공적으로 제출되었습니다.");
queryClient.invalidateQueries({ queryKey: [ScoresQueryKeys.myLanguageTestScore] });
},
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/community/deleteComment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import type { AxiosError } from "axios";

import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import { type CommentIdResponse, CommunityQueryKeys, communityApi } from "./api";

interface DeleteCommentRequest {
Expand All @@ -20,7 +20,7 @@ const useDeleteComment = () => {
onSuccess: (_data, variables) => {
// 해당 게시글 상세 쿼리를 무효화하여 댓글 목록 갱신
queryClient.invalidateQueries({ queryKey: [CommunityQueryKeys.posts, variables.postId] });
toast.success("댓글이 삭제되었습니다.");
showIconToast("logo", "댓글이 삭제되었습니다.");
},
});
};
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/community/deletePost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";

import type { AxiosError, AxiosResponse } from "axios";
import { useRouter } from "next/navigation";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { CommunityQueryKeys, communityApi, type DeletePostResponse } from "./api";

Expand Down Expand Up @@ -53,7 +53,7 @@ const useDeletePost = () => {
await revalidateCommunityPage(variables.boardCode, accessToken);
}

toast.success("게시글이 성공적으로 삭제되었습니다.");
showIconToast("logo", "게시글이 성공적으로 삭제되었습니다.");

// 게시글 목록 페이지 이동
router.replace(`/community/${variables.boardCode || "FREE"}`);
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/community/patchUpdatePost.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { CommunityQueryKeys, communityApi, type PostIdResponse, type PostUpdateRequest } from "./api";

Expand Down Expand Up @@ -51,7 +51,7 @@ const useUpdatePost = () => {
await revalidateCommunityPage(variables.boardCode, accessToken);
}

toast.success("게시글이 수정되었습니다.");
showIconToast("logo", "게시글이 수정되었습니다.");
},
});
};
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/apis/community/postCreateComment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import type { AxiosError } from "axios";

import { toast } from "react-hot-toast";
import { showIconToast } from "@/lib/toast/showIconToast";
import { type CommentCreateRequest, type CommentIdResponse, CommunityQueryKeys, communityApi } from "./api";

/**
Expand All @@ -15,7 +15,7 @@ const useCreateComment = () => {
onSuccess: (_data, variables) => {
// 해당 게시글 상세 쿼리를 무효화하여 댓글 목록 갱신
queryClient.invalidateQueries({ queryKey: [CommunityQueryKeys.posts, variables.postId] });
toast.success("댓글이 등록되었습니다.");
showIconToast("logo", "댓글이 등록되었습니다.");
},
});
};
Expand Down
Loading