Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/pages/result/components/matching-agree-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@ import { matchQueries } from '@apis/match/match-queries';
import Button from '@components/button/button/button';
import MatchCurrentCard from '@components/card/match-current-card/match-current-card';
import { LOTTIE_PATH } from '@constants/lotties';
import usePreventBackNavigation from '@hooks/use-prevent-back-navigation';
import { ROUTES } from '@routes/routes-config';
import { useSuspenseQuery } from '@tanstack/react-query';
import { Lottie } from '@toss/lottie';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';

interface MatchingAgreeViewProps {
matchId: string;
}

const MatchingAgreeView = ({ matchId }: MatchingAgreeViewProps) => {
const navigate = useNavigate();
const [params] = useSearchParams();
const cardType = params.get('cardtype');
usePreventBackNavigation(
`${ROUTES.MATCH}?tab=${cardType === 'group' ? '그룹' : '1:1'}&filter=전체`,
);

const { data: agreeData } = useSuspenseQuery(matchQueries.COUNTED_MEMBER(Number(matchId)));
const matchedCount = agreeData?.count;
Expand Down
8 changes: 6 additions & 2 deletions src/shared/components/header/utils/get-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ export const getHeaderContent = (
navigate(ROUTES.HOME);
return;
}

if (goMatchTypes.includes(type)) {
navigate(ROUTES.MATCH);
return;
}

if (isCreate) {
return null;
}
Expand All @@ -43,6 +41,12 @@ export const getHeaderContent = (
navigate(ROUTES.CHAT);
};

const isResult = Boolean(matchPath(`${ROUTES.RESULT()}`, pathname));
const isGroupAgree = isResult && urlParams.get('type') === 'agree';
if (isGroupAgree) {
return null;
}

if (pathname === ROUTES.HOME) {
return (
<Icon
Expand Down