Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gudusol committed Sep 19, 2024
2 parents 73f8776 + d36a070 commit eb95c88
Show file tree
Hide file tree
Showing 191 changed files with 4,448 additions and 804 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/image/graphics/image_comment_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
9 changes: 9 additions & 0 deletions public/svg/ic_black_and_white_logo.svg
4 changes: 4 additions & 0 deletions public/svg/ic_unlock.svg
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
17 changes: 12 additions & 5 deletions src/apis/domains/guest/usePatchGuestNickname.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { AxiosError } from 'axios';
import { Dispatch, RefObject, SetStateAction } from 'react';

import { patch } from '@apis/api';
import { QUERY_KEY } from '@apis/queryKeys/queryKeys';
Expand All @@ -23,18 +25,23 @@ const patchGuestNickname = async (
}
};

export const usePatchGuestNickname = (guestId: number, setErrorMessage: (msg: string) => void) => {
export const usePatchGuestNickname = (
guestId: number,
setIsNicknameDuplicate: Dispatch<SetStateAction<boolean>>,
nicknameRef: RefObject<HTMLInputElement>
) => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (guestNickname: string) => patchGuestNickname(guestId, guestNickname),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [QUERY_KEY.GUEST_INFO] });
},
onError: (error: ErrorType) => {
if (error.status === 40008) {
setErrorMessage('* 이미 존재하는 닉네임이에요.');
onError: (error: AxiosError<ErrorType>) => {
if (error.response?.data.status === 40008) {
setIsNicknameDuplicate(true);
nicknameRef.current?.focus();
} else {
setErrorMessage('닉네임 변경 중 오류가 발생했습니다. 다시 시도해 주세요.');
alert(error.message);
}
},
});
Expand Down
18 changes: 12 additions & 6 deletions src/apis/domains/moim/useFetchMyHost.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
import { useQuery } from '@tanstack/react-query';
import { useSuspenseQuery } from '@tanstack/react-query';
import axios from 'axios';

import { get } from '@apis/api';
import { QUERY_KEY } from '@apis/queryKeys/queryKeys';

import { components } from '@schema';
import { ApiResponseType } from '@types';
import { ApiResponseType, ErrorType } from '@types';

type HostGetResponse = components['schemas']['HostGetResponse'];

const getMyHostInfo = async (): Promise<HostGetResponse | null> => {
const getMyHostInfo = async (): Promise<HostGetResponse | ErrorType | null> => {
try {
const response = await get<ApiResponseType<HostGetResponse>>(`/v2/host`);
return response.data.data;
} catch (err) {
console.error(err);
return null;
if (axios.isAxiosError(err)) {
console.error(err);
return err.response?.data;
} else {
console.error(err);
return null;
}
}
};

export const useFetchMyHost = () => {
return useQuery({
return useSuspenseQuery({
queryKey: [QUERY_KEY.MY_HOST_INFO],
queryFn: () => getMyHostInfo(),
refetchOnWindowFocus: false,
Expand Down
2 changes: 0 additions & 2 deletions src/apis/domains/moimSubmission/usePatchSubmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export const usePatchSubmitter = (isOngoing: boolean, onClose: () => void) => {
const navigate = useNavigate();
const [user] = useAtom(userAtom);

console.log(QUERY_KEY.HOST_MOIM_INFO, user.hostId, isOngoing ? 'ongoing' : 'completed');

return useMutation({
mutationFn: ({ moimId, submitterIdList }: PatchSubmitterRequest) =>
patchSubmitter({ moimId, submitterIdList }),
Expand Down
2 changes: 1 addition & 1 deletion src/apis/domains/review/useFetchMoimFromReviewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getMoimInfo = async (moimId: string): Promise<MoimInfoResponse | null> =>
);
return response.data.data;
} catch (error) {
console.log(error);
console.error(error);
return null;
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/apis/domains/review/useFetchReviewTagList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const getTagList = async (): Promise<TagListResponse | null> => {
try {
const response = await get<ApiResponseType<TagListResponse>>('/v2/review/tag-list');
return response.data.data;
} catch {
console.log(console.log);
} catch (error) {
console.error(error);
return null;
}
};
Expand Down
7 changes: 4 additions & 3 deletions src/apis/domains/review/usePostReview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import { post } from '@apis/api';

import { components } from '@schema';
import { MutateResponseType } from '@types';
import { ErrorResponse, MutateResponseType } from '@types';

type ReviewCreateReqeust = components['schemas']['ReviewCreateReqeust'];

Expand All @@ -16,8 +16,9 @@ const postReview = async (params: ReviewCreateReqeust, moimId: number) => {
const response = await post<MutateResponseType>(`/v2/moim/${moimId}/review`, params);
return response.data;
} catch (error) {
console.log(error);
return null;
const errorResponse = error as ErrorResponse;
const errorData = errorResponse.response.data;
throw errorData;
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/apis/domains/submitter/usePatchMoimSubmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const usePatchMoimSubmitter = () => {
mutationFn: ({ moimSubmissionId }: PatchMoimSubmitterRequest) =>
patchMoimSubmitter({ moimSubmissionId }),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [QUERY_KEY.MOIM_SUBMITTER_ALL_REQUEST] });
queryClient.invalidateQueries({ queryKey: [QUERY_KEY.MOIM_SUBMITTER_ALL] });
},
});
};
1 change: 0 additions & 1 deletion src/apis/queryKeys/queryKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const QUERY_KEY = {
HOST_SUBMITTER: 'hostSubmitter',
HOST_SUBMIT_REQUEST: 'hostSubmitRequest',
MOIM_SUBMITTER_ALL: 'moimSubmitterAll',
MOIM_SUBMITTER_ALL_REQUEST: 'miomSubmitterAllRequest',
HOST_INFO: 'hostInfo',
HOST_INFO_CLASS: 'hostInfoClass',
HOST_INFO_REVIEW: 'hostInfoReview',
Expand Down
10 changes: 10 additions & 0 deletions src/assets/svg/IcBlackAndWhiteLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { SVGProps } from 'react';
const SvgIcBlackAndWhiteLogo = (props: SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 86 18" {...props}>
<path
fill="#6B6F77"
d="M11.043 6.5q0 .943-.445 1.78-.444.836-1.423 1.37-.98.516-2.51.516H4.423v5.018H2.395V2.816h4.27q1.424 0 2.403.499.996.48 1.477 1.317.498.836.498 1.868M6.665 8.51q1.157 0 1.727-.515.57-.534.57-1.495 0-2.029-2.297-2.029H4.423v4.04zM16.653 2.754l-1.762 8.63h-1.69l1.299-8.63zm-3.22 12.492q-.481 0-.784-.302a1.04 1.04 0 0 1-.302-.765q0-.624.462-1.068.48-.463 1.086-.463.48 0 .765.303.303.302.303.765 0 .623-.463 1.085a1.5 1.5 0 0 1-1.068.445M17.956 9q0-1.815.836-3.257a6.04 6.04 0 0 1 2.296-2.242 6.4 6.4 0 0 1 3.185-.818q1.976 0 3.506.978 1.549.961 2.242 2.74h-2.438q-.48-.978-1.334-1.458t-1.976-.48q-1.228 0-2.188.55a3.9 3.9 0 0 0-1.513 1.585Q20.038 7.63 20.038 9t.534 2.402a4 4 0 0 0 1.513 1.602q.96.552 2.188.552 1.122 0 1.976-.48.854-.482 1.334-1.46h2.438q-.693 1.78-2.242 2.74-1.53.961-3.506.961-1.743 0-3.185-.8a6.17 6.17 0 0 1-2.296-2.26q-.836-1.442-.836-3.257M38.14 15.184 33.355 9.65v5.534h-2.029V2.816h2.029v5.642l4.805-5.642h2.544L35.33 9.01l5.463 6.175zM52.275 6.5a4.2 4.2 0 0 1-.765 1.78q-.588.836-1.655 1.37-1.068.516-2.599.516h-2.242l-.89 5.018h-2.028l2.189-12.368h4.27q1.87 0 2.83.837.96.818.96 2.153 0 .232-.07.694M47.54 8.582q1.157 0 1.815-.552.677-.55.837-1.53a2.6 2.6 0 0 0 .053-.516q0-.747-.498-1.157-.48-.426-1.477-.427h-2.242l-.73 4.182zM55.678 13.547h4.182v1.637h-6.21V2.816h2.028zM63.192 4.463v3.63h4.27v1.655h-4.27v3.79h4.804v1.655h-6.833V2.808h6.834v1.655z"
/>
</svg>
);
export default SvgIcBlackAndWhiteLogo;
Loading

0 comments on commit eb95c88

Please sign in to comment.