From 38ffa63bed111f7c13fc6bb0ec329da91cdc45b9 Mon Sep 17 00:00:00 2001 From: Minsu Kim Date: Sat, 12 Oct 2024 00:05:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refac:=20=EA=B3=B5=EC=97=B0=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=8A=94=20=EB=A0=88=EC=9D=B4=EC=A7=80=20=EB=A1=9C?= =?UTF-8?q?=EB=94=A9=20=ED=95=98=EC=A7=80=20=EC=95=8A=EC=9C=BC=EB=A9=B0=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=9B=83=EC=9D=80=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=84=B0=EC=97=90=EC=84=9C=20=EC=A3=BC=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/src/App.tsx | 31 ++- .../ShowCastInfoFormDialogContent/index.tsx | 1 - .../src/components/ShowDetailLayout/index.tsx | 257 +++++++++--------- .../ShowBasicInfoFormContent.tsx | 3 +- .../ShowTicketInfoFormContent.tsx | 2 - .../src/components/ShowListItem/index.tsx | 8 + apps/admin/src/constants/routes.ts | 8 +- .../src/pages/ShowEnterancePage/index.tsx | 5 +- apps/admin/src/pages/ShowInfoPage/index.tsx | 90 +++--- .../src/pages/ShowReservationPage/index.tsx | 5 +- .../src/pages/ShowSettlementPage/index.tsx | 6 +- apps/admin/src/pages/ShowTicketPage/index.tsx | 6 +- 12 files changed, 225 insertions(+), 197 deletions(-) diff --git a/apps/admin/src/App.tsx b/apps/admin/src/App.tsx index 99c2b9df..2ed23ccf 100644 --- a/apps/admin/src/App.tsx +++ b/apps/admin/src/App.tsx @@ -25,11 +25,6 @@ import { OAuthKakaoPage, HomePage, ShowAddCompletePage, - ShowEnterancePage, - ShowInfoPage, - ShowReservationPage, - ShowSettlementPage, - ShowTicketPage, SignUpCompletePage, SitePolicyPage, GiftRegisterPage, @@ -39,6 +34,12 @@ import { import ShowAddPage from './pages/ShowAddPage'; import { Suspense } from 'react'; import { domAnimation, LazyMotion } from 'framer-motion'; +import ShowDetailLayout from './components/ShowDetailLayout'; +import ShowInfoPage from './pages/ShowInfoPage'; +import ShowTicketPage from './pages/ShowTicketPage'; +import ShowReservationPage from './pages/ShowReservationPage'; +import ShowSettlementPage from './pages/ShowSettlementPage'; +import ShowEnterancePage from './pages/ShowEnterancePage'; setDefaultOptions({ locale: ko }); @@ -125,15 +126,25 @@ const privateRoutes = [ { path: PATH.HOME, element: }, { path: PATH.SHOW_ADD, element: }, { path: PATH.SHOW_ADD_TICKET, element: }, - { path: PATH.SHOW_INFO, element: }, - { path: PATH.SHOW_TICKET, element: }, - { path: PATH.SHOW_RESERVATION, element: }, - { path: PATH.SHOW_ENTRANCE, element: }, - { path: PATH.SHOW_SETTLEMENT, element: }, { path: PATH.SHOW_ADD_COMPLETE, element: , }, + { + path: '/', + element: ( + + + + ), + children: [ + { path: PATH.SHOW_INFO, element: }, + { path: PATH.SHOW_TICKET, element: }, + { path: PATH.SHOW_RESERVATION, element: }, + { path: PATH.SHOW_ENTRANCE, element: }, + { path: PATH.SHOW_SETTLEMENT, element: }, + ], + }, ], }, ]; diff --git a/apps/admin/src/components/ShowCastInfoFormDialogContent/index.tsx b/apps/admin/src/components/ShowCastInfoFormDialogContent/index.tsx index 431b068c..7b725fea 100644 --- a/apps/admin/src/components/ShowCastInfoFormDialogContent/index.tsx +++ b/apps/admin/src/components/ShowCastInfoFormDialogContent/index.tsx @@ -99,7 +99,6 @@ const ShowCastInfoFormDialogContent = ({ onDelete, prevShowCastInfo, onSave }: P { const value = field.userCode; const isError = Boolean( diff --git a/apps/admin/src/components/ShowDetailLayout/index.tsx b/apps/admin/src/components/ShowDetailLayout/index.tsx index 48362584..99c9db48 100644 --- a/apps/admin/src/components/ShowDetailLayout/index.tsx +++ b/apps/admin/src/components/ShowDetailLayout/index.tsx @@ -1,7 +1,12 @@ -import { useMyHostInfo, useShowLastSettlementEvent, useShowSettlementInfo } from '@boolti/api'; +import { + useMyHostInfo, + useShowDetail, + useShowLastSettlementEvent, + useShowSettlementInfo, +} from '@boolti/api'; import { ArrowLeftIcon } from '@boolti/icon'; import { Setting } from '@boolti/icon/src/components/Setting.tsx'; -import { useDialog } from '@boolti/ui'; +import { palette, useDialog } from '@boolti/ui'; import { useTheme } from '@emotion/react'; import { useInView } from 'react-intersection-observer'; import { useMatch, useNavigate, useParams } from 'react-router-dom'; @@ -14,7 +19,7 @@ import Layout from '../Layout/index.tsx'; import Styled from './ShowDetailLayout.styles.ts'; import AuthoritySettingDialogContent from '../AuthoritySettingDialogContent'; import { HostListItem, HostType } from '@boolti/api/src/types/host.ts'; -import { atom, useAtom } from 'jotai'; +import { atom, useAtom, useAtomValue } from 'jotai'; import { useEffect } from 'react'; import { useDeviceWidth } from '~/hooks/useDeviceWidth.ts'; import ProfileDropdown from '../ProfileDropdown/index.tsx'; @@ -27,51 +32,64 @@ const settlementTooltipText = { }; interface ShowDetailLayoutProps { - showName: string; children?: React.ReactNode; - onClickMiddleware?: () => Promise; } export const myHostInfoAtom = atom(null); -const ShowDetailLayout = ({ showName, children, onClickMiddleware }: ShowDetailLayoutProps) => { - const { ref: topObserverRef, inView: topInView } = useInView({ - threshold: 1, - initialInView: true, - }); - const { ref: headerObserverRef, inView: headerInView } = useInView({ - threshold: 0.01, - initialInView: true, - }); - const theme = useTheme(); - const navigate = useNavigate(); +export const middlewareAtom = atom<(() => Promise) | undefined>(undefined); + +interface TabItemProps { + type: 'INFO' | 'TICKET' | 'RESERVATION' | 'ENTRANCE' | 'SETTLEMENT'; +} + +const matchTargets: Record = { + INFO: PATH.SHOW_INFO, + TICKET: PATH.SHOW_TICKET, + RESERVATION: PATH.SHOW_RESERVATION, + ENTRANCE: PATH.SHOW_ENTRANCE, + SETTLEMENT: PATH.SHOW_SETTLEMENT, +}; + +const toTargets = { + INFO: HREF.SHOW_INFO, + TICKET: HREF.SHOW_TICKET, + RESERVATION: HREF.SHOW_RESERVATION, + ENTRANCE: HREF.SHOW_ENTRANCE, + SETTLEMENT: HREF.SHOW_SETTLEMENT, +} as const; + +const label = { + INFO: '공연 기본 정보', + TICKET: '티켓 관리', + RESERVATION: '방문자 관리', + ENTRANCE: '입장 관리', + SETTLEMENT: '정산 관리', +}; + +const tooltipStyle = { + color: palette.grey.w, + padding: '6px 8px', + backgroundColor: palette.grey.g90, + borderRadius: '4px', + boxShadow: `0px 4px 10px 0px ${palette.shadow}`, + fontWeight: '400', + fontStyle: 'normal', + lineHeight: '18px', + fontDisplay: 'auto', + fontSize: '12px', +}; + +const TabItem = ({ type }: TabItemProps) => { const params = useParams<{ showId: string }>(); - const matchInfoTab = useMatch(PATH.SHOW_INFO); - const matchTicketTab = useMatch(PATH.SHOW_TICKET); - const matchReservationTab = useMatch(PATH.SHOW_RESERVATION); - const matchEntryTab = useMatch(PATH.SHOW_ENTRANCE); - const matchSettlementTab = useMatch(PATH.SHOW_SETTLEMENT); - const authoritySettingDialog = useDialog(); const showId = Number(params!.showId); - const [, setMyHostInfo] = useAtom(myHostInfoAtom); - const deviceWidth = useDeviceWidth(); - const isMobile = deviceWidth < parseInt(theme.breakpoint.mobile, 10); - const { data: myHostInfoData } = useMyHostInfo(showId); - const { data: lastSettlementEvent } = useShowLastSettlementEvent(showId); + const { data: settlementInfo } = useShowSettlementInfo(showId); + const { data: lastSettlementEvent } = useShowLastSettlementEvent(showId); - const tooltipStyle = { - color: theme.palette.grey.w, - padding: '6px 8px', - backgroundColor: theme.palette.grey.g90, - borderRadius: '4px', - boxShadow: `0px 4px 10px 0px ${theme.palette.shadow}`, - fontWeight: '400', - fontStyle: 'normal', - lineHeight: '18px', - fontDisplay: 'auto', - fontSize: '12px', - }; + const match = useMatch(matchTargets[type]); + const navigate = useNavigate(); + const middleware = useAtomValue(middlewareAtom); const isSettlementInfoEmpty = settlementInfo?.bankAccount === null || @@ -94,12 +112,74 @@ const ShowDetailLayout = ({ showName, children, onClickMiddleware }: ShowDetailL return false; })(); + return ( + { + if (!params.showId) return; + + if (middleware && !(await middleware())) { + return; + } + + navigate(toTargets[type](params.showId)); + }} + > + {label[type]} + {isTooltipVisible && ( + + )} + + ); +}; + +const ShowDetailLayout = ({ children }: ShowDetailLayoutProps) => { + const { ref: topObserverRef, inView: topInView } = useInView({ + threshold: 1, + initialInView: true, + }); + const { ref: headerObserverRef, inView: headerInView } = useInView({ + threshold: 0.01, + initialInView: true, + }); + const theme = useTheme(); + const navigate = useNavigate(); + const params = useParams<{ showId: string }>(); + + const authoritySettingDialog = useDialog(); + const showId = Number(params!.showId); + + const [, setMyHostInfo] = useAtom(myHostInfoAtom); + + const deviceWidth = useDeviceWidth(); + const isMobile = deviceWidth < parseInt(theme.breakpoint.mobile, 10); + + const { data: show } = useShowDetail(showId); + const { data: myHostInfoData } = useMyHostInfo(showId); + + const middleware = useAtomValue(middlewareAtom); + useEffect(() => { if (myHostInfoData) { setMyHostInfo({ ...myHostInfoData }); } }, [myHostInfoData, setMyHostInfo]); + if (!show || !myHostInfoData) { + return null; + } + return ( <> @@ -112,7 +192,7 @@ const ShowDetailLayout = ({ showName, children, onClickMiddleware }: ShowDetailL { - if (onClickMiddleware && !(await onClickMiddleware())) { + if (middleware && !(await middleware())) { return; } @@ -128,7 +208,9 @@ const ShowDetailLayout = ({ showName, children, onClickMiddleware }: ShowDetailL /> - {showName} + + {show?.name} + {myHostInfoData?.type !== HostType.SUPPORTER && ( - { - if (!params.showId) return; - - if (onClickMiddleware && !(await onClickMiddleware())) { - return; - } - - navigate(HREF.SHOW_INFO(params.showId)); - }} - > - 공연 기본 정보 - - { - if (!params.showId) return; - - if (onClickMiddleware && !(await onClickMiddleware())) { - return; - } - - navigate(HREF.SHOW_TICKET(params.showId)); - }} - > - 티켓 관리 - - { - if (!params.showId) return; - - if (onClickMiddleware && !(await onClickMiddleware())) { - return; - } - - navigate(HREF.SHOW_RESERVATION(params.showId)); - }} - > - 방문자 관리 - - { - if (!params.showId) return; - - if (onClickMiddleware && !(await onClickMiddleware())) { - return; - } - - navigate(HREF.SHOW_ENTRANCE(params.showId)); - }} - > - 입장 관리 - - { - if (!params.showId) return; - - if (onClickMiddleware && !(await onClickMiddleware())) { - return; - } - - navigate(HREF.SHOW_SETTLEMENT(params.showId)); - }} - id="settlement-page-tooltip" - > - 정산 관리 - {isTooltipVisible && ( - - )} - + + + + + diff --git a/apps/admin/src/components/ShowInfoFormContent/ShowBasicInfoFormContent.tsx b/apps/admin/src/components/ShowInfoFormContent/ShowBasicInfoFormContent.tsx index dc31121f..fea5be56 100644 --- a/apps/admin/src/components/ShowInfoFormContent/ShowBasicInfoFormContent.tsx +++ b/apps/admin/src/components/ShowInfoFormContent/ShowBasicInfoFormContent.tsx @@ -33,7 +33,7 @@ const ShowBasicInfoFormContent = ({ const { open, close, isOpen } = useDialog(); const detailAdressInputRef = useRef(null); - const { watch, control, setValue } = form; + const { control, setValue } = form; const { getRootProps, getInputProps } = useDropzone({ accept: { @@ -176,7 +176,6 @@ const ShowBasicInfoFormContent = ({ setHasBlurred((prev) => ({ ...prev, date: true })); }} placeholder={value} - defaultValue={watch('date')} min={format(add(new Date(), { days: 1 }), 'yyyy-MM-dd')} required disabled={disabled} diff --git a/apps/admin/src/components/ShowInfoFormContent/ShowTicketInfoFormContent.tsx b/apps/admin/src/components/ShowInfoFormContent/ShowTicketInfoFormContent.tsx index 83765b59..1e54673c 100644 --- a/apps/admin/src/components/ShowInfoFormContent/ShowTicketInfoFormContent.tsx +++ b/apps/admin/src/components/ShowInfoFormContent/ShowTicketInfoFormContent.tsx @@ -59,7 +59,6 @@ const ShowTicketInfoFormContent = ({ sub(showDate ? new Date(showDate) : new Date(), { days: 1 }), 'yyyy-MM-dd', )} - defaultValue={watch('startDate') || ''} required disabled={disabled} errorMessage={ @@ -98,7 +97,6 @@ const ShowTicketInfoFormContent = ({ sub(showDate ? new Date(showDate) : new Date(), { days: 1 }), 'yyyy-MM-dd', )} - defaultValue={watch('endDate') || ''} required disabled={disabled} errorMessage={ diff --git a/apps/admin/src/components/ShowListItem/index.tsx b/apps/admin/src/components/ShowListItem/index.tsx index de2955be..7890dd7a 100644 --- a/apps/admin/src/components/ShowListItem/index.tsx +++ b/apps/admin/src/components/ShowListItem/index.tsx @@ -8,6 +8,7 @@ import { PATH } from '~/constants/routes'; import Styled from './ShowListItem.styles'; import { HostType } from '@boolti/api/src/types/host'; +import { queryKeys, useQueryClient } from '@boolti/api'; interface Props { isEmpty?: boolean; @@ -68,6 +69,7 @@ const ShowListItem = ({ salesStartTime, salesEndTime, }: Props) => { + const queryClient = useQueryClient(); const navigate = useNavigate(); return ( @@ -75,6 +77,12 @@ const ShowListItem = ({ 아직 등록한 공연이 없어요. ) : ( { + queryClient.prefetchQuery(queryKeys.show.detail(id)); + queryClient.prefetchQuery(queryKeys.host.me(id)); + queryClient.prefetchQuery(queryKeys.show.lastSettlementEvent(id)); + queryClient.prefetchQuery(queryKeys.show.settlementInfo(id)); + }} onClick={() => { if (myHostType === HostType.SUPPORTER) { navigate(generatePath(PATH.SHOW_RESERVATION, { showId: id.toString() })); diff --git a/apps/admin/src/constants/routes.ts b/apps/admin/src/constants/routes.ts index c8e1cfff..65e8e328 100644 --- a/apps/admin/src/constants/routes.ts +++ b/apps/admin/src/constants/routes.ts @@ -1,19 +1,23 @@ export const PATH = { INDEX: '/', + QR: '/qr', + HOME: '/home', + LOGIN: '/login', OAUTH_KAKAO: '/oauth/kakao', OAUTH_APPLE: '/oauth/apple', SIGNUP_COMPLETE: '/signup/complete', - HOME: '/home', + SHOW_ADD: '/show/add', - QR: '/qr', SHOW_ADD_TICKET: '/show/add/ticket', SHOW_ADD_COMPLETE: '/show/add/complete', + SHOW_INFO: '/show/:showId/info', SHOW_TICKET: '/show/:showId/ticket', SHOW_RESERVATION: '/show/:showId/reservation', SHOW_ENTRANCE: '/show/:showId/enterance', SHOW_SETTLEMENT: '/show/:showId/settlement', + SITE_POLICY: '/site-policy/:policyId', GIFT_INTRO: '/gift/:giftId', GIFT_REGISTER: '/gift/:giftId/register', diff --git a/apps/admin/src/pages/ShowEnterancePage/index.tsx b/apps/admin/src/pages/ShowEnterancePage/index.tsx index 045beeaa..6e5c102d 100644 --- a/apps/admin/src/pages/ShowEnterancePage/index.tsx +++ b/apps/admin/src/pages/ShowEnterancePage/index.tsx @@ -13,7 +13,6 @@ import EnteranceTable from '~/components/EnteranceTable'; import EntranceConfirmDialogContent from '~/components/EntranceConfirmDialogContent'; import MobileCardList from '~/components/MobileCardList'; import Pagination from '~/components/Pagination'; -import ShowDetailLayout from '~/components/ShowDetailLayout'; import TicketTypeSelect from '~/components/TicketTypeSelect'; import Styled from './ShowEnterancePage.styles'; @@ -82,7 +81,7 @@ const ShowEnterancePage = () => { const { managerCode } = enteranceInfo ?? {}; return ( - + <> {totalTicketCount === 0 ? ( @@ -203,7 +202,7 @@ const ShowEnterancePage = () => { )} )} - + ); }; diff --git a/apps/admin/src/pages/ShowInfoPage/index.tsx b/apps/admin/src/pages/ShowInfoPage/index.tsx index 698fe831..a432a214 100644 --- a/apps/admin/src/pages/ShowInfoPage/index.tsx +++ b/apps/admin/src/pages/ShowInfoPage/index.tsx @@ -16,12 +16,12 @@ import { } from '@boolti/api'; import { Button, Drawer, ShowPreview, useConfirm, useDialog, useToast } from '@boolti/ui'; import { compareAsc, format } from 'date-fns'; -import { useEffect, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { SubmitHandler, useForm } from 'react-hook-form'; import { useNavigate, useParams } from 'react-router-dom'; import ShowDeleteForm from '~/components/ShowDeleteForm'; -import ShowDetailLayout, { myHostInfoAtom } from '~/components/ShowDetailLayout'; +import { middlewareAtom, myHostInfoAtom } from '~/components/ShowDetailLayout'; import ShowBasicInfoFormContent from '~/components/ShowInfoFormContent/ShowBasicInfoFormContent'; import ShowDetailInfoFormContent from '~/components/ShowInfoFormContent/ShowDetailInfoFormContent'; import { ShowInfoFormInputs } from '~/components/ShowInfoFormContent/types'; @@ -29,7 +29,7 @@ import { PATH } from '~/constants/routes'; import PreviewFrame from './PreviewFrame'; import Styled from './ShowInfoPage.styles'; -import { useAtom } from 'jotai'; +import { useAtom, useSetAtom } from 'jotai'; import { HostType } from '@boolti/api/src/types/host'; import ShowDetailUnauthorized from '~/components/ShowDetailUnauthorized'; import Portal from '@boolti/ui/src/components/Portal'; @@ -65,49 +65,54 @@ const ShowInfoPage = () => { const confirm = useConfirm(); const deleteShowDialog = useDialog(); + const setMiddleware = useSetAtom(middlewareAtom); + const [previewDrawerOpen, setPreviewDrawerOpen] = useState(false); useBodyScrollLock(previewDrawerOpen); - const onSubmit: SubmitHandler = async (data) => { - if (!show) return; + const onSubmit: SubmitHandler = useCallback( + async (data) => { + if (!show) return; - const newImageFiles = imageFiles.filter((file) => file.preview.startsWith('blob:')); - const newShowImages = await (async () => { - if (newImageFiles.length === 0) return []; + const newImageFiles = imageFiles.filter((file) => file.preview.startsWith('blob:')); + const newShowImages = await (async () => { + if (newImageFiles.length === 0) return []; - return await uploadShowImageMutation.mutateAsync(newImageFiles); - })(); + return await uploadShowImageMutation.mutateAsync(newImageFiles); + })(); - await editShowInfoMutation.mutateAsync({ - showId: show.id, - body: { - name: data.name, - images: [...showImages, ...newShowImages].map((image, index) => ({ - sequence: index + 1, - thumbnailPath: image.thumbnailPath, - path: image.path, - })), - date: `${data.date}T${data.startTime}:00.000Z`, - runningTime: Number(data.runningTime), - place: { - name: data.placeName, - streetAddress: data.placeStreetAddress, - detailAddress: data.placeDetailAddress, + await editShowInfoMutation.mutateAsync({ + showId: show.id, + body: { + name: data.name, + images: [...showImages, ...newShowImages].map((image, index) => ({ + sequence: index + 1, + thumbnailPath: image.thumbnailPath, + path: image.path, + })), + date: `${data.date}T${data.startTime}:00.000Z`, + runningTime: Number(data.runningTime), + place: { + name: data.placeName, + streetAddress: data.placeStreetAddress, + detailAddress: data.placeDetailAddress, + }, + notice: data.notice, + host: { + name: data.hostName, + phoneNumber: data.hostPhoneNumber, + }, }, - notice: data.notice, - host: { - name: data.hostName, - phoneNumber: data.hostPhoneNumber, - }, - }, - }); + }); - toast.success('공연 정보를 저장했습니다.'); - setPreviewDrawerOpen(false); - }; + toast.success('공연 정보를 저장했습니다.'); + setPreviewDrawerOpen(false); + }, + [editShowInfoMutation, imageFiles, show, showImages, uploadShowImageMutation], + ); - const confirmSaveShowInfo = async () => { + const confirmSaveShowInfo = useCallback(async () => { if (!showInfoForm.formState.isDirty && !isImageFilesDirty) { return true; } @@ -125,7 +130,7 @@ const ShowInfoPage = () => { } return true; - }; + }, [isImageFilesDirty, onSubmit, showInfoForm]); useEffect(() => { if (!show) return; @@ -147,6 +152,13 @@ const ShowInfoPage = () => { setShowImages(show.images); }, [show, showInfoForm]); + useEffect(() => { + setMiddleware(() => confirmSaveShowInfo); + return () => { + setMiddleware(undefined); + }; + }, [confirmSaveShowInfo, setMiddleware]); + if (!show || !showSalesInfo || !castTeamList) { return null; } @@ -154,7 +166,7 @@ const ShowInfoPage = () => { const salesStarted = compareAsc(new Date(showSalesInfo.salesStartTime), new Date()) === -1; return ( - + <> {myHostInfo?.type === HostType.SUPPORTER ? ( { )} - + ); }; diff --git a/apps/admin/src/pages/ShowReservationPage/index.tsx b/apps/admin/src/pages/ShowReservationPage/index.tsx index 2d442012..6250ba69 100644 --- a/apps/admin/src/pages/ShowReservationPage/index.tsx +++ b/apps/admin/src/pages/ShowReservationPage/index.tsx @@ -11,7 +11,6 @@ import { useParams } from 'react-router-dom'; import MobileCardList from '~/components/MobileCardList'; import Pagination from '~/components/Pagination'; import ReservationTable from '~/components/ReservationTable'; -import ShowDetailLayout from '~/components/ShowDetailLayout'; import TicketTypeSelect from '~/components/TicketTypeSelect'; import Styled from './ShowReservationPage.styles'; @@ -86,7 +85,7 @@ const ShowReservationPage = () => { } = reservationSummary; return ( - + <> {totalSoldCount === 0 ? ( @@ -208,7 +207,7 @@ const ShowReservationPage = () => { )} )} - + ); }; diff --git a/apps/admin/src/pages/ShowSettlementPage/index.tsx b/apps/admin/src/pages/ShowSettlementPage/index.tsx index 8ee1535d..63bf7a30 100644 --- a/apps/admin/src/pages/ShowSettlementPage/index.tsx +++ b/apps/admin/src/pages/ShowSettlementPage/index.tsx @@ -23,7 +23,7 @@ import { Document, Page, pdfjs } from 'react-pdf'; import { useParams } from 'react-router-dom'; import FileInput from '~/components/FileInput/FileInput'; -import ShowDetailLayout, { myHostInfoAtom } from '~/components/ShowDetailLayout'; +import { myHostInfoAtom } from '~/components/ShowDetailLayout'; import Styled from './ShowSettlementPage.styles'; import { useAtom } from 'jotai'; @@ -86,7 +86,7 @@ const ShowSettlementPage = () => { if (!show) return null; return ( - + <> {myHostInfo?.type !== HostType.MAIN ? ( { )} )} - + ); }; diff --git a/apps/admin/src/pages/ShowTicketPage/index.tsx b/apps/admin/src/pages/ShowTicketPage/index.tsx index 10ace450..151371e2 100644 --- a/apps/admin/src/pages/ShowTicketPage/index.tsx +++ b/apps/admin/src/pages/ShowTicketPage/index.tsx @@ -15,7 +15,7 @@ import { useEffect } from 'react'; import { SubmitHandler, useForm } from 'react-hook-form'; import { useParams } from 'react-router-dom'; -import ShowDetailLayout, { myHostInfoAtom } from '~/components/ShowDetailLayout'; +import { myHostInfoAtom } from '~/components/ShowDetailLayout'; import ShowInvitationTicketFormContent from '~/components/ShowInfoFormContent/ShowInvitationTicketFormContent'; import ShowSalesTicketFormContent from '~/components/ShowInfoFormContent/ShowSalesTicketFormContent'; import ShowTicketInfoFormContent from '~/components/ShowInfoFormContent/ShowTicketInfoFormContent'; @@ -74,7 +74,7 @@ const ShowTicketPage = () => { if (!show || !showSalesInfo) return null; return ( - + <> {myHostInfo?.type === HostType.SUPPORTER ? ( { )} - + ); }; From 6930f63089b5eb0cdf5c32a6948ad1899a219635 Mon Sep 17 00:00:00 2001 From: Minsu Kim Date: Sat, 12 Oct 2024 00:14:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=EB=A6=B0=ED=8A=B8=20=EA=B2=BD?= =?UTF-8?q?=EA=B3=A0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/src/pages/ShowInfoPage/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/admin/src/pages/ShowInfoPage/index.tsx b/apps/admin/src/pages/ShowInfoPage/index.tsx index a432a214..400997e4 100644 --- a/apps/admin/src/pages/ShowInfoPage/index.tsx +++ b/apps/admin/src/pages/ShowInfoPage/index.tsx @@ -109,7 +109,7 @@ const ShowInfoPage = () => { toast.success('공연 정보를 저장했습니다.'); setPreviewDrawerOpen(false); }, - [editShowInfoMutation, imageFiles, show, showImages, uploadShowImageMutation], + [editShowInfoMutation, imageFiles, show, showImages, toast, uploadShowImageMutation], ); const confirmSaveShowInfo = useCallback(async () => { @@ -130,7 +130,7 @@ const ShowInfoPage = () => { } return true; - }, [isImageFilesDirty, onSubmit, showInfoForm]); + }, [confirm, isImageFilesDirty, onSubmit, showInfoForm]); useEffect(() => { if (!show) return;