diff --git a/packages/web/src/components/Skeleton/Routes.tsx b/packages/web/src/components/Skeleton/Routes.tsx index e72fe0b31..5334b1fbe 100644 --- a/packages/web/src/components/Skeleton/Routes.tsx +++ b/packages/web/src/components/Skeleton/Routes.tsx @@ -53,7 +53,7 @@ const routeProps = [ exact: true, }, { - path: "/mypage", + path: ["/mypage", "/mypage/:options"], component: lazy(() => import("@/pages/Mypage")), exact: true, }, diff --git a/packages/web/src/pages/Mypage/index.tsx b/packages/web/src/pages/Mypage/index.tsx index ac10c4073..e4f36dd8d 100644 --- a/packages/web/src/pages/Mypage/index.tsx +++ b/packages/web/src/pages/Mypage/index.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; +import { useParams } from "react-router-dom"; import channelService from "@/hooks/skeleton/useChannelTalkEffect/channelService"; import { useValueRecoilState } from "@/hooks/useFetchRecoilState"; @@ -45,14 +45,18 @@ const Mypage = () => { const [isOpenEventPolicy, setIsOpenEventPolicy] = useState(false); const [isOpenMembers, setOpenIsMembers] = useState(false); - const { search } = useLocation(); + const { options } = useParams<{ + options: string; + }>(); useEffect(() => { - const channeltalk = new URLSearchParams(search).get("channeltalk"); - if (channeltalk === "true") { + if (options === "report") { + setIsOpenReport(true); + } + if (options === "channeltalk") { channelService.showMessenger(); } - }, [search]); + }, [options]); const onClickProfileModify = useCallback( () => setIsOpenProfileModify(true),