Skip to content

Commit 32da647

Browse files
committed
fix(client): useShowConfettiEffect -> useShowConfetti로 네이밍 변경
1 parent 8b23a2a commit 32da647

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

apps/client/src/components/coffeechat/CoffeechatAcceptConfirm/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useQueryClient } from '@tanstack/react-query';
33
import { useAcceptCoffeechat } from '@/hooks/api/coffeechat/useAcceptCoffeechat';
44
import { RECEIVE_COFFEE_CHAT_LIST } from '@/hooks/api/coffeechat/useGetReceiveCoffeechatList';
55
import { USER_QUERY_KEY } from '@/hooks/api/user/useGetUser';
6-
import { useShowConfettiEffect } from '@/hooks/common/useShowConfettiEffect';
6+
import { useShowConfetti } from '@/hooks/common/useShowConfetti';
77
import { useLogAnalyticsEvent } from '@/libs/logging';
88

99
type CoffeechatAcceptConfirmProps = {
@@ -17,7 +17,7 @@ const CoffeechatAcceptConfirm = ({
1717
}: CoffeechatAcceptConfirmProps) => {
1818
const queryClient = useQueryClient();
1919
const { logClickEvent } = useLogAnalyticsEvent();
20-
const { showConfettiEffect } = useShowConfettiEffect();
20+
const { showConfetti } = useShowConfetti();
2121
const { mutate: acceptCoffeechatMutate } = useAcceptCoffeechat(coffeechatId, {
2222
onSuccess: () => {
2323
logClickEvent({
@@ -28,7 +28,7 @@ const CoffeechatAcceptConfirm = ({
2828
});
2929
queryClient.invalidateQueries({ queryKey: [RECEIVE_COFFEE_CHAT_LIST] });
3030
queryClient.invalidateQueries({ queryKey: [USER_QUERY_KEY] });
31-
showConfettiEffect();
31+
showConfetti();
3232
},
3333
});
3434

apps/client/src/components/coffeechat/CoffeechatSendConfirm/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useForm } from 'react-hook-form';
77
import { SEND_COFFEE_CHAT_LIST } from '@/hooks/api/coffeechat/useGetSendCoffeechatList';
88
import { useSendCoffeechat } from '@/hooks/api/coffeechat/useSendCoffeechat';
99
import type { SendCoffeechatRequest } from '@/hooks/api/coffeechat/useSendCoffeechat';
10-
import { useShowConfettiEffect } from '@/hooks/common/useShowConfettiEffect';
10+
import { useShowConfetti } from '@/hooks/common/useShowConfetti';
1111
import { useLogAnalyticsEvent } from '@/libs/logging';
1212
import { useToast } from '@/libs/toast';
1313

@@ -25,7 +25,7 @@ const CoffeechatSendConfirm = ({
2525
const router = useRouter();
2626
const queryClient = useQueryClient();
2727
const { toast } = useToast();
28-
const { showConfettiEffect } = useShowConfettiEffect();
28+
const { showConfetti } = useShowConfetti();
2929
const { logClickEvent } = useLogAnalyticsEvent();
3030
const {
3131
register,
@@ -38,7 +38,7 @@ const CoffeechatSendConfirm = ({
3838
logClickEvent({ name: 'click_send_coffeechat', params: sendCoffeechatRequest });
3939
queryClient.invalidateQueries({ queryKey: [SEND_COFFEE_CHAT_LIST] });
4040
router.replace('/profile');
41-
showConfettiEffect();
41+
showConfetti();
4242
toast.info('커피챗 요청을 보냈어요!', {
4343
action: {
4444
label: '확인하러 가기',
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import JSConfetti from 'js-confetti';
22

3-
export const useShowConfettiEffect = () => {
3+
export const useShowConfetti = () => {
44
const jsConfetti = new JSConfetti();
55

6-
const showConfettiEffect = () => {
6+
const showConfetti = () => {
77
jsConfetti.addConfetti({
88
confettiColors: ['#7046F7', '#8D6BF9', '#A990FA', '#C6B5FC'],
99
confettiNumber: 500,
1010
});
1111
};
1212

13-
return { showConfettiEffect };
13+
return { showConfetti };
1414
};

packages/ui/src/Portal/hooks/useDidMount.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ export const useDidMount = (callback: EffectCallback) => {
55
const didMountRef = useRef(false);
66

77
useEffect(() => {
8-
if (didMountRef.current) return;
8+
if (didMountRef.current) {
9+
return;
10+
}
911
didMountRef.current = true;
1012

1113
callback();
14+
// eslint-disable-next-line react-hooks/exhaustive-deps
1215
}, []);
1316
};

packages/ui/src/Portal/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const Portal = ({ isOpen, children }: PortalProps) => {
1717
}
1818
});
1919

20-
if (!container) return null;
20+
if (!container) {
21+
return null;
22+
}
2123

2224
return createPortal(isOpen && children, container);
2325
};

0 commit comments

Comments
 (0)