Skip to content

Commit

Permalink
fix: 이벤트 홈 페이지에 있을 땐 토큰이 있어도 지출 상세로 접근 불가하도록 수정 (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhokim98 authored Oct 23, 2024
1 parent ccf8327 commit 86b36ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/src/components/StepList/Step.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsxImportSource @emotion/react */
import {useNavigate} from 'react-router-dom';
import {useMatch, useNavigate} from 'react-router-dom';
import {css} from '@emotion/react';

import Amount from '@components/Design/components/Amount/Amount';
Expand Down
8 changes: 6 additions & 2 deletions client/src/pages/EventPage/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {EventPageContextProps} from '../EventPageLayout';

import {useNavigate, useOutletContext} from 'react-router-dom';
import {useMatch, useNavigate, useOutletContext} from 'react-router-dom';

import StepList from '@components/StepList/Steps';
import useRequestGetSteps from '@hooks/queries/step/useRequestGetSteps';
Expand All @@ -13,10 +13,14 @@ import {Icon, Tab, Tabs, Title} from '@HDesign/index';

import getEventIdByUrl from '@utils/getEventIdByUrl';

import {ROUTER_URLS} from '@constants/routerUrls';

import {receiptStyle} from './HomePage.style';

const HomePage = () => {
const {isAdmin, eventName} = useOutletContext<EventPageContextProps>();
const isInHomePage = useMatch(ROUTER_URLS.home) !== null;

const {steps} = useRequestGetSteps();
const {totalExpenseAmount} = useTotalExpenseAmountStore();
const {images} = useRequestGetImages();
Expand All @@ -38,7 +42,7 @@ const HomePage = () => {
/>
<Tabs>
<Tab label="참여자 별 정산" content={<Reports />} />
<Tab label="전체 지출 내역" content={<StepList data={steps ?? []} isAdmin={isAdmin} />} />
<Tab label="전체 지출 내역" content={<StepList data={steps ?? []} isAdmin={isAdmin && !isInHomePage} />} />
</Tabs>
</div>
);
Expand Down

0 comments on commit 86b36ca

Please sign in to comment.