From 00b6f0b1d6157056da94370c3f06c517cf085cd5 Mon Sep 17 00:00:00 2001 From: Siwoo Lee Date: Sat, 1 Jun 2024 22:29:34 +0900 Subject: [PATCH] Refactor: onTouchEnd => onClick --- src/components/coffee/LogInCTA.tsx | 2 +- src/components/common/Button.tsx | 9 +-------- src/components/common/CTA.tsx | 2 +- src/components/common/CoffeeOptionSelection.tsx | 8 ++++---- src/components/common/FooterIcon.tsx | 2 +- src/components/common/Header.tsx | 2 +- src/components/common/HeaderCloseIcon.tsx | 2 +- src/components/common/HeaderIcon.tsx | 2 +- src/components/common/Icon.tsx | 3 --- src/components/common/ImgRegister.tsx | 2 +- src/components/common/Input.tsx | 6 ++---- src/components/common/ModalCTA.tsx | 12 +++++------- src/components/common/SelectBox.tsx | 10 +++++----- src/components/common/SelectBtn.tsx | 6 +++--- src/components/common/SelectOption.tsx | 11 +++-------- src/components/common/Taps.tsx | 6 +++--- src/components/follow/FollowBtn.tsx | 2 +- src/components/home/CaffeineFilter.tsx | 2 +- src/components/home/CoffeeMenuSelection.tsx | 8 ++++---- src/components/home/CoffeeSelection.tsx | 2 +- src/components/home/WaterIntake.tsx | 2 +- src/components/home/WaterPerCoffee.tsx | 2 +- src/components/mypage/MyProfile.tsx | 4 ++-- src/components/post/CafeDetail.tsx | 8 ++++---- src/components/post/CafeDetailContent.tsx | 8 ++++---- src/components/post/PostDetail.tsx | 2 +- src/components/post/PostRegister.tsx | 3 ++- src/components/post/ReplyToPanel.tsx | 2 +- src/components/post/overlay/Option.tsx | 8 ++++---- src/components/post/overlay/PostOwnerOption.tsx | 4 ++-- src/components/post/overlay/PublicOption.tsx | 2 +- src/components/posts/following/PostBody.tsx | 10 +++++----- src/components/posts/following/PostCard.tsx | 2 +- src/components/posts/trend/DailyTrendCard.tsx | 2 +- src/components/posts/trend/PostsSortBy.tsx | 4 ++-- src/components/profile/FollowCount.tsx | 4 ++-- src/components/profile/PostsGrid.tsx | 6 +++--- src/components/report/ReportReason.tsx | 8 ++++---- src/components/search/SearchBar.tsx | 4 ++-- src/components/start/BrandItem.tsx | 4 ++-- src/components/start/InitialForm.tsx | 2 +- src/components/start/SelectFavBrand.tsx | 2 +- src/components/start/SignIn.tsx | 10 +++++----- src/components/support/CustomerCenter.tsx | 2 +- src/hooks/MyPage/useHandleAuth.ts | 2 +- src/hooks/useSelectBox.ts | 4 ++-- src/hooks/useSelectTap.tsx | 2 +- src/pages/Page-Error.tsx | 2 +- src/pages/Page-Follow.tsx | 2 +- src/pages/Page-Profile.tsx | 2 +- src/pages/Page-Report.tsx | 6 +++--- src/types/types.ts | 7 +++---- 52 files changed, 106 insertions(+), 125 deletions(-) diff --git a/src/components/coffee/LogInCTA.tsx b/src/components/coffee/LogInCTA.tsx index ce4e65ba..4508961a 100644 --- a/src/components/coffee/LogInCTA.tsx +++ b/src/components/coffee/LogInCTA.tsx @@ -20,7 +20,7 @@ const LogInCTA = () => { {logInCTA.text} ); @@ -43,8 +42,7 @@ export const Input = ({ submitBtn = ( ); diff --git a/src/components/common/ModalCTA.tsx b/src/components/common/ModalCTA.tsx index 6c5e3303..09bf157b 100644 --- a/src/components/common/ModalCTA.tsx +++ b/src/components/common/ModalCTA.tsx @@ -26,7 +26,7 @@ const ModalCTA = ({ text: string; subBtnText?: string; isConfirm?: boolean; - fn: React.TouchEventHandler; + fn: React.MouseEventHandler; }) => { const [isModal, setIsModal] = useRecoilState(isModalState); @@ -38,12 +38,12 @@ const ModalCTA = ({ diff --git a/src/components/support/CustomerCenter.tsx b/src/components/support/CustomerCenter.tsx index 63393b11..ebf81b74 100644 --- a/src/components/support/CustomerCenter.tsx +++ b/src/components/support/CustomerCenter.tsx @@ -18,7 +18,7 @@ const CustomerCenter = () => { {seletedTap === taps[0] ? : } diff --git a/src/hooks/MyPage/useHandleAuth.ts b/src/hooks/MyPage/useHandleAuth.ts index 7563bd36..b9ce97a8 100644 --- a/src/hooks/MyPage/useHandleAuth.ts +++ b/src/hooks/MyPage/useHandleAuth.ts @@ -42,7 +42,7 @@ export const useHandleAuth = () => { setIsConfirm(!isConfirm); }; - const handleDeleteAccount = (e: React.TouchEvent) => { + const handleDeleteAccount = (e: React.MouseEvent) => { if (!isModal) { e.preventDefault(); setIsModal(true); diff --git a/src/hooks/useSelectBox.ts b/src/hooks/useSelectBox.ts index 431935cc..290eff71 100644 --- a/src/hooks/useSelectBox.ts +++ b/src/hooks/useSelectBox.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; export const useSelectBox = (selectRef: React.RefObject) => { const [isSelect, setIsSelect] = useState(false); - const handleSelectTouch = () => { + const handleSelectClick = () => { setIsSelect(!isSelect); if (selectRef.current) { selectRef.current.focus(); @@ -27,5 +27,5 @@ export const useSelectBox = (selectRef: React.RefObject) => { }; }, []); - return { isSelect, handleSelectTouch }; + return { isSelect, handleSelectClick }; }; diff --git a/src/hooks/useSelectTap.tsx b/src/hooks/useSelectTap.tsx index a5531374..aaa3c5ba 100644 --- a/src/hooks/useSelectTap.tsx +++ b/src/hooks/useSelectTap.tsx @@ -3,7 +3,7 @@ import { useState } from 'react'; export const useSelectTap = (initial: string) => { const [seletedTap, setSelectedTap] = useState(initial); - const handleSelectTap = (e: React.TouchEvent) => { + const handleSelectTap = (e: React.MouseEvent) => { e.preventDefault(); setSelectedTap(e.currentTarget?.value); }; diff --git a/src/pages/Page-Error.tsx b/src/pages/Page-Error.tsx index d6fd5971..e3696624 100644 --- a/src/pages/Page-Error.tsx +++ b/src/pages/Page-Error.tsx @@ -26,7 +26,7 @@ const Error = () => {