Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVP 10 2차 QA 반영 #266

Merged
merged 7 commits into from
Jan 17, 2025
18 changes: 7 additions & 11 deletions apps/admin/src/components/ShowCastInfo/ShowCastInfo.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ const HeaderNameWrapper = styled.div`
`;

const Handle = styled.button`
display: none;

${mq_lg} {
display: inline-flex;
align-items: center;
justify-content: center;
color: ${({ theme }) => theme.palette.grey.g40};
cursor: grab;
user-select: none;
user-zoom: none;
}
display: inline-flex;
align-items: center;
justify-content: center;
color: ${({ theme }) => theme.palette.grey.g40};
cursor: grab;
user-select: none;
user-zoom: none;
`;

const Name = styled.span`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ const ShowCastInfoFormDialogContent = ({ prevShowCastInfo, onDelete, onSave }: P
} catch {
toast.error(
'불티에 회원으로 등록된 식별 코드로만 등록이 가능합니다.' +
'\n' +
'식별 코드를 확인 후 다시 시도해 주세요.',
'\n' +
'식별 코드를 확인 후 다시 시도해 주세요.',
);
} finally {
setIsMemberFieldBlurred((prev) => {
Expand Down Expand Up @@ -262,7 +262,7 @@ const ShowCastInfoFormDialogContent = ({ prevShowCastInfo, onDelete, onSave }: P
</DndContext>
<Styled.MemberAddButton
onClick={() => {
append({ id: -Math.floor(Math.random() * 1000000) });
append({ id: -Math.floor(Math.random() * 1000000), userCode: '', userNickname: '', roleName: '', userImgPath: '' });
setIsMemberFieldBlurred((prev) => [...prev, { userCode: false, roleName: false }]);
}}
>
Expand Down
14 changes: 13 additions & 1 deletion apps/admin/src/components/ShowDeleteDialogContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
import { useDeleteShow, useShowDetail } from '@boolti/api';
import ShowDeleteForm from '../ShowDeleteForm';
import { useToast } from '@boolti/ui';
import { useNavigate } from 'react-router-dom'
import { PATH } from '~/constants/routes';
import { useBodyScrollLock } from '~/hooks/useBodyScrollLock';

interface ShowDeleteDialogContentProps {
showId: number;
onDeleteShow?: () => void;
}

const ShowDeleteDialogContent: React.FC<ShowDeleteDialogContentProps> = ({ showId }) => {
const ShowDeleteDialogContent: React.FC<ShowDeleteDialogContentProps> = ({ showId, onDeleteShow }) => {
const navigate = useNavigate()

const { data: show } = useShowDetail(showId);
const deleteShowMutation = useDeleteShow();

const toast = useToast();

useBodyScrollLock();

if (!show) return;

return (
<ShowDeleteForm
showName={show.name}
onSubmit={async () => {
if (deleteShowMutation.isLoading) return

try {
await deleteShowMutation.mutateAsync(showId);
toast.success('공연을 삭제했습니다.');
navigate(PATH.HOME)
onDeleteShow?.()
} catch (_) {
toast.error('공연을 삭제하지 못했습니다. 잠시 후 다시 시도해주세요.');
}
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/src/components/ShowDetailLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const tooltipStyle = {
const TabItem = ({ type }: TabItemProps) => {
const params = useParams<{ showId: string }>();
const showId = Number(params!.showId);
const [myHostInfo] = useAtom(myHostInfoAtom);

const { data: settlementInfo } = useShowSettlementInfo(showId);
const { data: lastSettlementEvent } = useShowLastSettlementEvent(showId);
Expand All @@ -99,6 +100,8 @@ const TabItem = ({ type }: TabItemProps) => {
settlementInfo?.settlementBankAccountPhotoFile === null;

const isTooltipVisible = (() => {
if (myHostInfo?.type !== HostType.MAIN) return false;

if (
lastSettlementEvent?.settlementEventType === 'REQUEST' ||
lastSettlementEvent?.settlementEventType === 'DONE' ||
Expand Down Expand Up @@ -252,7 +255,7 @@ const ShowDetailLayout = ({ children }: ShowDetailLayoutProps) => {
},
deleteShow: {
title: '공연 삭제',
children: () => <ShowDeleteDialogContent showId={showId} />,
children: () => <ShowDeleteDialogContent showId={showId} onDeleteShow={showSettingDialog.close} />,
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const HostList = ({ showId, onCloseDialog }: HostListProps) => {
const confirmText =
type === HostType.MANAGER
? `${hostName}의 권한을 관리자로 수정하시겠어요?${'\n'}관리자는 권한 편집이 가능하며, 정산 관리 페이지 이외의 모든 페이지 접근이 가능합니다.`
: `${hostName}의 권한을 도우미로 수정하시겠어요?${'\n'}도우미는 권한 편집이 불가하며, 방문자/입장 관리 페이지만 접근이 가능합니다.`;
: `${hostName}의 권한을 도우미로 수정하시겠어요?${'\n'}도우미는 권한 편집이 불가하며, 방문자 관리 페이지만 접근이 가능합니다.`;
const result = await confirm(confirmText, {
cancel: '취소하기',
confirm: '수정하기',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const dropdownItems: HostTypeInfo[] = [
];

const HostListItem = ({ host, onEdit, onDelete }: HostListItemProps) => {
const { isOpen, toggleDropdown } = useDropdown();
const { isOpen, dropdownRef, toggleDropdown } = useDropdown();
const [myHostInfo] = useAtom(myHostInfoAtom);

const getHostTypeName = (type: HostType) => {
Expand Down Expand Up @@ -65,7 +65,7 @@ const HostListItem = ({ host, onEdit, onDelete }: HostListItemProps) => {
<Styled.HostName>{host.hostName}</Styled.HostName>
{host.self && <Styled.HostSelfLabel>(나)</Styled.HostSelfLabel>}
</Styled.HostInfoWrapper>
<Styled.Dropdown>
<Styled.Dropdown ref={dropdownRef}>
<Styled.NameButton
onClick={() => {
if (host.type === HostType.MAIN || myHostInfo?.type === HostType.SUPPORTER) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ChevronRightIcon } from '@boolti/icon';
import { myHostInfoAtom } from '../ShowDetailLayout';
import { useAtom } from 'jotai';
import { HostType } from '@boolti/api/src/types/host';
import { useBodyScrollLock } from '~/hooks/useBodyScrollLock';

interface ShowSettingDialogContentProps {
showId: number;
Expand All @@ -30,6 +31,8 @@ const ShowSettingDialogContent = ({

const [myHostInfo] = useAtom(myHostInfoAtom);

useBodyScrollLock();

return (
<Styled.Container>
<Styled.Section>
Expand Down
Loading