Skip to content

Commit

Permalink
feat: 공연 미리보기 모바일 대응 (운영 배포) (#145)
Browse files Browse the repository at this point in the history
* fix: 401 에러 관련 수정 (#140)

* fix: 드롭다운 색상 수정

* fix: 인증 관련 오류 수정

* fix: 글로벌 에러바운더리 추가

* chore: 주석 코드 리버트

* fix: 덜컥임 수정, 필드 추가 (#142)

* fix: StrictMode 제거 및 불필요한 의존성 제거

* fix: 덜컥임 없도록 수정

* feat: ShowSalesTicketResponse 하위 필드 추가

* feat: 공연 미리보기 모바일 대응 (#144)

---------

Co-authored-by: Minsu Kim <alstn2468_@naver.com>
  • Loading branch information
Puterism and alstn2468 authored Aug 6, 2024
1 parent 600d8a3 commit 6060c77
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 4 deletions.
58 changes: 56 additions & 2 deletions apps/admin/src/pages/ShowInfoPage/ShowInfoPage.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,28 @@ const ShowInfoPreview = styled.div`
justify-content: center;
align-items: center;
position: relative;
overflow-y: auto;
${mq_lg} {
overflow-y: initial;
}
`;

const ShowInfoPreviewMobile = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow-y: auto;
z-index: 999;
padding-bottom: 84px;
background-color: ${({ theme }) => theme.palette.mobile.grey.g95};
${mq_lg} {
padding-bottom: 0;
display: none;
}
`;

const ShowInfoPreviewFrameContainer = styled.div`
Expand Down Expand Up @@ -102,12 +124,31 @@ const ShowPreview = styled.div`
`;

const ShowInfoPreviewFooter = styled.div`
height: 52px;
height: 84px;
display: flex;
padding: 20px 16px;
gap: 8px;
background-color: ${({ theme }) => theme.palette.mobile.grey.g95};
position: fixed;
bottom: 0;
left: 0;
width: 100%;
${mq_lg} {
height: 52px;
padding: 0;
gap: 0;
background-color: none;
position: initial;
bottom: initial;
left: initial;
width: initial;
}
`;

const ShowInfoPreviewCloseButton = styled.button`
width: 220px;
flex: 1;
height: 100%;
background-color: ${({ theme }) => theme.palette.grey.g90};
color: ${({ theme }) => theme.palette.grey.w};
Expand All @@ -116,6 +157,13 @@ const ShowInfoPreviewCloseButton = styled.button`
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 4px;
${mq_lg} {
width: 220px;
flex: initial;
border-radius: none;
}
`;

const ShowInfoPreviewSubmitButton = styled.button`
Expand All @@ -128,6 +176,11 @@ const ShowInfoPreviewSubmitButton = styled.button`
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 4px;
${mq_lg} {
border-radius: none;
}
`;

export default {
Expand All @@ -140,6 +193,7 @@ export default {
DeleteButton,
ShowInfoPreviewContainer,
ShowInfoPreview,
ShowInfoPreviewMobile,
ShowInfoPreviewFrameContainer,
ShowInfoPreviewFrame,
ShowPreviewContainer,
Expand Down
51 changes: 51 additions & 0 deletions apps/admin/src/pages/ShowInfoPage/ShowInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Styled from './ShowInfoPage.styles';
import { useAtom } from 'jotai';
import { HostType } from '@boolti/api/src/types/host';
import ShowDetailUnauthorized from '~/components/ShowDetailUnauthorized';
import Portal from '@boolti/ui/src/components/Portal';

const ShowInfoPage = () => {
const params = useParams<{ showId: string }>();
Expand Down Expand Up @@ -278,6 +279,56 @@ const ShowInfoPage = () => {
</Styled.ShowInfoPreviewFooter>
</Styled.ShowInfoPreviewContainer>
</Drawer>
{previewDrawerOpen && (
<Portal>
<Styled.ShowInfoPreviewMobile>
<Styled.ShowInfoPreview>
<ShowPreview
show={{
images: imageFiles.map((file) => file.preview),
name: showInfoForm.watch('name') ? showInfoForm.watch('name') : '',
date: showInfoForm.watch('date')
? format(showInfoForm.watch('date'), 'yyyy.MM.dd (E)')
: '',
startTime: showInfoForm.watch('startTime'),
runningTime: showInfoForm.watch('runningTime'),
salesStartTime: showSalesInfo
? format(showSalesInfo.salesStartTime, 'yyyy.MM.dd (E)')
: '',
salesEndTime: showSalesInfo
? format(showSalesInfo.salesEndTime, 'yyyy.MM.dd (E)')
: '',
placeName: showInfoForm.watch('placeName'),
placeStreetAddress: showInfoForm.watch('placeStreetAddress'),
placeDetailAddress: showInfoForm.watch('placeDetailAddress'),
notice: showInfoForm.watch('notice'),
hostName: showInfoForm.watch('hostName'),
hostPhoneNumber: showInfoForm.watch('hostPhoneNumber'),
}}
hasNoticePage
/>
</Styled.ShowInfoPreview>
<Styled.ShowInfoPreviewFooter>
<Styled.ShowInfoPreviewCloseButton
type="button"
onClick={() => {
setPreviewDrawerOpen(false);
}}
>
닫기
</Styled.ShowInfoPreviewCloseButton>
<Styled.ShowInfoPreviewSubmitButton
type="button"
onClick={() => {
showInfoForm.handleSubmit(onSubmit)();
}}
>
저장하기
</Styled.ShowInfoPreviewSubmitButton>
</Styled.ShowInfoPreviewFooter>
</Styled.ShowInfoPreviewMobile>
</Portal>
)}
</Styled.ShowInfoForm>
</Styled.ShowInfoPage>
)}
Expand Down
14 changes: 12 additions & 2 deletions packages/ui/src/components/Drawer/Drawer.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from '@emotion/styled';
import { animated } from '@react-spring/web';
import { mq_lg } from '../../systems';

interface DrawerProps {
width?: string;
Expand All @@ -9,13 +10,17 @@ const DimmedArea = styled(animated.div)`
position: fixed;
inset: 0;
background-color: ${({ theme }) => theme.palette.dim.dialog};
display: flex;
display: none;
justify-content: center;
align-items: center;
z-index: 999;
${mq_lg} {
display: flex;
}
`;

const Drawer = styled(animated.div)<DrawerProps>`
const Drawer = styled(animated.div) <DrawerProps>`
position: fixed;
top: 0;
right: 0;
Expand All @@ -24,6 +29,11 @@ const Drawer = styled(animated.div)<DrawerProps>`
background-color: ${({ theme }) => theme.palette.grey.w};
box-shadow: -12px 0px 20px 0px ${({ theme }) => theme.palette.shadow};
z-index: 1000;
display: none;
${mq_lg} {
display: block;
}
`;

const DrawerHeader = styled.div`
Expand Down

0 comments on commit 6060c77

Please sign in to comment.