Skip to content

공연 내용 웹뷰 제공 #283

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

Merged
merged 2 commits into from
Apr 5, 2025
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
12 changes: 8 additions & 4 deletions apps/preview/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { HelmetProvider } from 'react-helmet-async';
import ShowPreviewPage from './pages/ShowPreviewPage';
import { fetcher } from '@boolti/api/src/fetcher';
import NotFound from './components/NotFound';
import ShowPreviewNoticePage from './pages/ShowPreviewNoticePage';
import ShowInfoDetailPage from './pages/ShowInfoDetailPage';

const router = createBrowserRouter([
{
Expand All @@ -28,12 +28,16 @@ const router = createBrowserRouter([
errorElement: <NotFound />,
},
{
path: '/show/:showId/notice',
element: <ShowPreviewNoticePage />,
path: '/show/:showId/info',
element: <ShowInfoDetailPage />,
loader: async ({ params }) => {
const showId = params.showId;
if (showId) {
return await fetcher.get<ShowPreviewResponse>(`web/papi/v1/shows/${showId}`);
const response = await Promise.all([
fetcher.get<ShowPreviewResponse>(`web/papi/v1/shows/${showId}`),
fetcher.get<{ count: number }>(`web/papi/v1/shows/${showId}/sold-ticket-counts`),
])
return response;
}
},
errorElement: <NotFound />,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import styled from '@emotion/styled'

const Container = styled.div`
background-color : ${({ theme }) => theme.palette.mobile.grey.g95};
padding: 0 20px;
`

export default {
Container,
}
46 changes: 46 additions & 0 deletions apps/preview/src/pages/ShowInfoDetailPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { ShowPreviewResponse } from "@boolti/api";
import { ShowInfoDetail } from "@boolti/ui";
import { format } from "date-fns";
import { useLoaderData } from "react-router-dom";
import Styled from './ShowInfoDetailPage.styles';

const ShowInfoDetailPage: React.FC = () => {
const [show, { count: soldTicketCount }] = useLoaderData() as ShowPreviewResponse;

const {
notice,
salesEndTime,
salesStartTime,
hostName,
isEnded
} = show;

const callLinkClickHandler = () => {
location.href = `tel:${show.hostPhoneNumber}`;
}

const messageLinkClickHandler = () => {
location.href = `sms:${show.hostPhoneNumber}`;
}

return (
<Styled.Container>
<ShowInfoDetail
show={{
salesStartTime: format(new Date(salesStartTime), 'yyyy.MM.dd (E)'),
salesEndTime: format(new Date(salesEndTime), 'yyyy.MM.dd (E)'),
notice,
hostName,
isEnded,
}}
soldTicketCount={soldTicketCount}
onClickCallLink={callLinkClickHandler}
onClickMessageLink={messageLinkClickHandler}
onClickCallLinkMobile={callLinkClickHandler}
onClickMessageLinkMobile={messageLinkClickHandler}
/>
</Styled.Container>
);
}

export default ShowInfoDetailPage;
25 changes: 0 additions & 25 deletions apps/preview/src/pages/ShowPreviewNoticePage/index.tsx

This file was deleted.

Empty file.
48 changes: 24 additions & 24 deletions packages/ui/src/components/ShowPreview/ShowInfoDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
import Styled from './ShowPreview.styles';
import { CallIcon, MessageIcon } from '@boolti/icon';
import { CallIcon, MessageIcon, TicketIcon } from '@boolti/icon';

import ShowInfoDescription from '../ShowContentMarkdown';

interface Props {
show: {
images: string[];
name: string;
date: string;
startTime: string;
runningTime: string;
salesStartTime: string;
salesEndTime: string;
placeName: string;
placeStreetAddress: string;
placeDetailAddress: string;
notice: string;
hostName: string;
hostPhoneNumber: string;
isEnded: boolean;
};
soldTicketCount?: number;
hasNoticePage?: boolean;
onClickLink?: () => void;
onClickLinkMobile?: () => void;
onClickCallLink?: () => void;
onClickMessageLink?: () => void;
onClickCallLinkMobile?: () => void;
onClickMessageLinkMobile?: () => void;
onClickViewNotice?: () => void;
}

const ShowInfoDetail = ({
show: {
// date,
// startTime,
// runningTime,
salesStartTime,
salesEndTime,
// placeName,
// placeStreetAddress,
// placeDetailAddress,
notice,
hostName,
isEnded,
},
soldTicketCount,
hasNoticePage,
onClickLink,
onClickLinkMobile,
onClickCallLink,
onClickMessageLink,
onClickCallLinkMobile,
onClickMessageLinkMobile,
onClickViewNotice,
}: Props) => {
return (
Expand All @@ -52,6 +45,13 @@ const ShowInfoDetail = ({
<Styled.ShowInfoDescription>
{salesStartTime} - {salesEndTime}
</Styled.ShowInfoDescription>
{isEnded && soldTicketCount !== undefined && (
<Styled.ShowTicketInfoDescription>
<Styled.TicketIcon>
<TicketIcon />
</Styled.TicketIcon> {soldTicketCount}매 판매 완료
</Styled.ShowTicketInfoDescription>
)}
</Styled.ShowInfoGroup>
<Styled.ShowInfoGroup>
<Styled.ShowInfoTitleContainer>
Expand All @@ -73,18 +73,18 @@ const ShowInfoDetail = ({
<Styled.ShowHost>
<Styled.ShowHostName>{hostName}</Styled.ShowHostName>
<Styled.ShowHostLink>
<a onClick={onClickLink}>
<a onClick={onClickCallLink}>
<CallIcon />
</a>
<a onClick={onClickLink}>
<a onClick={onClickMessageLink}>
<MessageIcon />
</a>
</Styled.ShowHostLink>
<Styled.ShowHostLinkMobile>
<a onClick={onClickLinkMobile}>
<a onClick={onClickCallLinkMobile}>
<CallIcon />
</a>
<a onClick={onClickLinkMobile}>
<a onClick={onClickMessageLinkMobile}>
<MessageIcon />
</a>
</Styled.ShowHostLinkMobile>
Expand Down
21 changes: 21 additions & 0 deletions packages/ui/src/components/ShowPreview/ShowPreview.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ const ShowInfoDescription = styled.div<ShowInfoDescriptionProps>`
color: ${({ theme }) => theme.palette.mobile.grey.g30};
overflow-wrap: break-word;
word-break: break-word;
display: flex;
align-items: center;

${({ isFullContent }) =>
isFullContent &&
Expand All @@ -238,6 +240,23 @@ const ShowInfoDescription = styled.div<ShowInfoDescriptionProps>`
`}
`;

const ShowTicketInfoDescription = styled.div`
${({ theme }) => theme.typo.b3};
color: ${({ theme }) => theme.palette.mobile.grey.g30};
overflow-wrap: break-word;
word-break: break-word;
display: flex;
align-items: center;
gap: 8px;
margin-top: 4px;
`;

const TicketIcon = styled.div`
display: inline-flex;
align-items: center;
justify-content: center;
`

const ShowInfoDescriptionBadge = styled.div`
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -398,6 +417,8 @@ export default {
ShowInfoTitleTextButton,
ShowInfoSubtitle,
ShowInfoDescription,
ShowTicketInfoDescription,
TicketIcon,
ShowInfoDescriptionBadge,
ShowInfoBox,
ShowHost,
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/src/components/ShowPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ const ShowPreview = ({
<ShowInfoDetail
show={show}
hasNoticePage={hasNoticePage}
onClickLink={onClickLink}
onClickLinkMobile={onClickLinkMobile}
onClickCallLink={onClickLink}
onClickMessageLink={onClickLink}
onClickCallLinkMobile={onClickLinkMobile}
onClickMessageLinkMobile={onClickLinkMobile}
onClickViewNotice={() => {
containerScrollTop.current = containerRef?.current?.scrollTop ?? null;
containerRef?.current?.scrollTo(0, 0);
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import StepProgressBar from './StepProgressBar';
import Checkbox from './Checkbox';
import StepDialog from './Dialog/StepDialog';
import ShowContentMarkdown from './ShowContentMarkdown';
import ShowInfoDetail from './ShowPreview/ShowInfoDetail';

export {
AgreeCheck,
Expand All @@ -35,5 +36,6 @@ export {
StepProgressBar,
Checkbox,
StepDialog,
ShowContentMarkdown
ShowContentMarkdown,
ShowInfoDetail,
};
Loading