From 7a595ef4a2495ffac66d37928bc3f089afb3bc09 Mon Sep 17 00:00:00 2001 From: goeun208 <80875784+goeun208@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:59:07 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=ED=88=AC=ED=91=9C=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC,=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20Redirect?= =?UTF-8?q?=20url=20=EC=88=98=EC=A0=95=20(#81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: scrollbar 숨기기, url 복사 baseURL 수정 * Fix: user 페이지 박스 스타일 수정 * Fix: 오류 제거, Feat: 라우팅 에러 처리 * Fix: vercel warning 제거 * Chore: 모임 생성 useEffect 변수 삭제 * Fix: 투표 종료 버튼 보이기, Kakao btn url 변경 --- .../common/button/kakao/KakaoButton.tsx | 2 +- src/components/common/button/url/index.tsx | 4 ++-- src/components/common/footer/index.tsx | 4 ++-- src/components/main/index.tsx | 6 ++++++ src/pages/vote/detail/[id].tsx | 16 ++++++++++++---- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/components/common/button/kakao/KakaoButton.tsx b/src/components/common/button/kakao/KakaoButton.tsx index 1527401..db23361 100644 --- a/src/components/common/button/kakao/KakaoButton.tsx +++ b/src/components/common/button/kakao/KakaoButton.tsx @@ -4,7 +4,7 @@ import { useRouter } from 'next/router'; const KakaoLoginButton = () => { const router = useRouter(); const REST_API_KEY = 'da98b670c28171c6bae91e1f6fa272c3'; - const REDIRECT_URI = 'http://localhost:3000/login/kakao'; + const REDIRECT_URI = 'https://www.moidot.co.kr/login/kakao'; const LINK = `https://kauth.kakao.com/oauth/authorize?client_id=${REST_API_KEY}&redirect_uri=${REDIRECT_URI}&response_type=code`; function kakaoLogin() { diff --git a/src/components/common/button/url/index.tsx b/src/components/common/button/url/index.tsx index 21c1831..3f0cff1 100644 --- a/src/components/common/button/url/index.tsx +++ b/src/components/common/button/url/index.tsx @@ -33,8 +33,8 @@ const UrlButton = ({ pathname }: UrlProps) => { { title: '모이닷으로 가기', link: { - mobileWebUrl: 'https://developers.kakao.com', - webUrl: `http://localhost:3000/invite/${pathname.split('/').slice(-1)[0]}`, + mobileWebUrl: `https://www.moidot.co.kr/invite/${pathname.split('/').slice(-1)[0]}`, + webUrl: `https://www.moidot.co.kr/invite/${pathname.split('/').slice(-1)[0]}`, }, }, ], diff --git a/src/components/common/footer/index.tsx b/src/components/common/footer/index.tsx index fde8f29..0d646ae 100644 --- a/src/components/common/footer/index.tsx +++ b/src/components/common/footer/index.tsx @@ -9,9 +9,9 @@ const Footer = () => {
이용약관
|
-
개인정보처리방침
+
개인정보 수집 및 처리방침
|
-
위치기반서비스이용약관
+
위치정보 수집 및 활용방침
|
소개
|
diff --git a/src/components/main/index.tsx b/src/components/main/index.tsx index 5e4817e..b1118ad 100644 --- a/src/components/main/index.tsx +++ b/src/components/main/index.tsx @@ -10,6 +10,7 @@ import api from '@/services/TokenService'; import { useGetGroup } from '@/hooks/useGetGroup'; import KakaoMap from './KakaoMap'; import { groupIdAtom } from '@/states/groupIdAtom'; + interface MainProps { id: string; } @@ -34,12 +35,17 @@ const Main = ({ id }: MainProps) => { // 0번째 추천 지역 대상으로 lat,lng 추출 console.log(groupData); + if (groupData) { lat = groupData?.data[0].latitude; lng = groupData?.data[0].longitude; local = groupData?.data[0].name; } + if (groupNameData) { + sessionStorage.setItem('adminId', groupNameData?.data?.adminEmail); + } + // 현재 로그인된 유저의 path const userPath = groupData?.data[0].moveUserInfo.filter((item) => item.userId === userId); // 유저 이외의 사람들의 path diff --git a/src/pages/vote/detail/[id].tsx b/src/pages/vote/detail/[id].tsx index c8a79e3..ded5f98 100644 --- a/src/pages/vote/detail/[id].tsx +++ b/src/pages/vote/detail/[id].tsx @@ -12,7 +12,6 @@ import { useGetGroupVote } from '@/hooks/useGetGroupVote'; import { VoteStatusData } from '@/types/VoteType'; import api from '@/services/TokenService'; import { useRecoilValue, RecoilEnv } from 'recoil'; -import { groupAdminIdAtom } from '@/states/groupAdminIdAtom'; import { VoteSelectData, postGroupVoteSelect } from '@/apis/postGroupVoteSelect'; import { useMutation } from '@tanstack/react-query'; import { groupIdAtom } from '@/states/groupIdAtom'; @@ -23,6 +22,7 @@ const VoteDetailPage = () => { RecoilEnv.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED = false; // eslint-disable-next-line react-hooks/exhaustive-deps let votePlaceIds: any = []; + // const [voteIds, setVoteIds] = useState(); const locationUrl = useRouter(); const [voteData, setVoteData] = useState(); // 투표 전체 데이터 const [voteEndAt, setVoteEndAt] = useState(''); // 투표 종료 시간 데이터 @@ -32,14 +32,19 @@ const VoteDetailPage = () => { const [voteMax, setVoteMax] = useState(); const token = api.getToken(); const groupIdData = useRecoilValue(groupIdAtom); - const groupAdminId = useRecoilValue(groupAdminIdAtom); + // const groupAdminId = useRecoilValue(groupAdminIdAtom); + const groupAdminId = typeof window !== 'undefined' ? sessionStorage.getItem('adminId') : null; + const response = useGetGroupVote(token, groupIdData.groupId); const currentId = api.getEmail(); const voteP: voteSelectPlaceData = { groupId: groupIdData.groupId, bestPlaceIds: votePlaceIds, }; - + useEffect(() => { + // eslint-disable-next-line react-hooks/exhaustive-deps + votePlaceIds = []; + }, []); //투표 데이터 voteData 변수에 저장하기 useEffect(() => { if (response.data?.message === '성공') setVoteData(response.data?.data); @@ -52,7 +57,7 @@ const VoteDetailPage = () => { setVoteEndAt(changeDate); }, [voteData?.endAt]); - //재투표 버튼 눌렀을 때 체크한 데이터 저장하기 + //보류 --- 재투표 버튼 눌렀을 때 체크한 데이터 저장하기 useEffect(() => { const temp = voteData?.voteStatuses.filter((item) => item.isVoted); temp?.map((item) => votePlaceIds.push(item.bestPlaceId)); @@ -68,6 +73,9 @@ const VoteDetailPage = () => { console.log('voteMax is...', voteMax); }, [voteData?.isClosed, voteData?.voteStatuses, voteMax]); + useEffect(() => { + console.log('voteIDS... : ', votePlaceIds); + }, [votePlaceIds]); //투표 참여 API react-query mutation const postGroupVoteSelectMutation = useMutation((data: VoteSelectData) => postGroupVoteSelect(token, data), { onSuccess: () => {