Skip to content
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
4 changes: 2 additions & 2 deletions apps/profile/src/components/Header/Header.styles.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { mq_lg } from '@boolti/ui';
import styled from '@emotion/styled';

const Header = styled.div<{ hasTitle: boolean }>`
const Header = styled.div<{ hasTitle: boolean; rightButton: boolean }>`
height: 60px;
display: flex;
align-items: center;
padding: 0 20px;
color: ${({ theme }) => theme.palette.grey.g10};
justify-content: ${({ hasTitle }) => (hasTitle ? 'space-between' : 'flex-end')};
padding: ${({ rightButton }) => (rightButton ? 0 : '0 20px')};

${mq_lg} {
position: relative;
Expand Down
7 changes: 6 additions & 1 deletion apps/profile/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ const Header = ({ title, rightButton }: Props) => {
const navigate = useNavigate();

const hasTitle = Boolean(title);
const hasRightButton = Boolean(rightButton);

return (
<Styled.Header hasTitle={hasTitle} onClick={() => navigate(-1)}>
<Styled.Header
hasTitle={hasTitle}
rightButton={hasRightButton}
onClick={() => navigate(-1)}
>
{title && (
<Styled.Left>
<Styled.BackButton>
Expand Down
19 changes: 18 additions & 1 deletion apps/profile/src/components/VideoCard/VideoCard.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ const VideoCard = styled.a`
`;

const VideoThumbnailWrapper = styled.div`
position: relative;
width: 160px;
height: 90px;
border-radius: 4px;
overflow: hidden;
gap: 6px;
background-color: ${({ theme }) => theme.palette.mobile.grey.g80};
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #2e303a;
`;

const VideoInfo = styled.div`
Expand Down Expand Up @@ -36,6 +46,13 @@ const VideoThumbnail = styled.img`
const VideoTitle = styled.p`
${({ theme }) => theme.typo.sh1};
color: #f6f7ff;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
`;

export default {
Expand Down
14 changes: 12 additions & 2 deletions apps/profile/src/components/VideoCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useYoutubeVideoDuration } from '@boolti/api';
import { formatYoutubeDuration, getYoutubeThumbnailUrl, getYoutubeVideoId } from '~/utils';
import Styled from './VideoCard.styles';
import { BooltiDarkIcon, BooltiDarkLogo } from '@boolti/icon';

interface VideoCardProps {
videoUrl: string;
Expand All @@ -9,16 +10,25 @@ interface VideoCardProps {
const VideoCard = ({ videoUrl }: VideoCardProps) => {
const videoId = getYoutubeVideoId(videoUrl) as string;
const { data } = useYoutubeVideoDuration(videoId);
const thumbnailUrl = videoId ? getYoutubeThumbnailUrl(videoId) : null;

const formattedDuration = formatYoutubeDuration(data?.duration ?? null);

return (
<Styled.VideoCard href={videoUrl} target="_blank" rel="noopener noreferrer">
<Styled.VideoThumbnailWrapper>
<Styled.VideoThumbnail src={getYoutubeThumbnailUrl(videoId)} alt="YouTube video" />
{thumbnailUrl ? (
<Styled.VideoThumbnail src={thumbnailUrl} alt="YouTube video" />
) : (
<>
<BooltiDarkIcon />
<BooltiDarkLogo />
</>
)}
</Styled.VideoThumbnailWrapper>
<Styled.VideoInfo>
<Styled.VideoTitle>{data?.title ?? '알 수 없는 동영상'}</Styled.VideoTitle>
{formattedDuration && <Styled.VideoDuration>{formattedDuration}</Styled.VideoDuration>}
<Styled.VideoDuration>{data?.duration ? formattedDuration : '-'}</Styled.VideoDuration>
</Styled.VideoInfo>
</Styled.VideoCard>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/profile/src/pages/ProfileLinkPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const ProfileLinkPage = () => {
return (
<Layout>
<Header title="링크" />
<Styled.CountText>전체 {data?.length || 0}</Styled.CountText>
<Styled.CountText>전체 ({data?.length || 0})</Styled.CountText>
<Styled.Container>
{data?.map((link, index) => (
<Styled.LinkItem
Expand Down
7 changes: 6 additions & 1 deletion apps/profile/src/pages/ProfilePage/ProfilePage.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const bottomSheetOverrides = css`
}
`;

const ContentSection = styled.div`
margin: 8px 0px;
`;

const CoverSection = styled.div<{ isCover: boolean; isDesktop: boolean }>`
position: relative;
width: 100%;
Expand Down Expand Up @@ -136,7 +140,7 @@ const IconButton = styled.a`
`;

const Section = styled.div`
padding: 32px 20px 24px 20px;
padding: 24px 20px;
`;

const PastShowSection = styled.div`
Expand Down Expand Up @@ -443,6 +447,7 @@ const Divider = styled.hr`
`;

export default {
ContentSection,
CoverSection,
CoverImage,
CoverOverlay,
Expand Down
194 changes: 98 additions & 96 deletions apps/profile/src/pages/ProfilePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const ProfilePage = () => {

dialog.open({
title: '불티 앱에서 프로필 만들기',
isBackdropClosable: false,
content: (
<Styled.DialogContainer>
<Styled.DialogQRCodeContainer>
Expand Down Expand Up @@ -205,110 +206,111 @@ const ProfilePage = () => {
)}
</Styled.ActionButtons>
</Styled.CoverBottomSection>

{profile.comingSoonShow.isVisible && profile.comingSoonShow.totalSize > 0 && (
<Styled.Section>
<Styled.SectionHeader>
<Styled.SectionTitle>다가오는 공연</Styled.SectionTitle>
</Styled.SectionHeader>
<Styled.ShowList>
{profile.comingSoonShow.previewItems.map((show) => (
<Styled.ShowCard
key={show.id}
href={EXTERNAL_URL.SHOW_MANAGER_INFO(show.id)}
target="_blank"
rel="noopener noreferrer"
>
<Styled.ShowImage src={show.showImg} alt={show.name} />
<Styled.ShowInfo>
<Styled.ShowTitle>{show.name}</Styled.ShowTitle>
<Styled.ShowDetail>{formatDateTimeWithWeekday(show.date)}</Styled.ShowDetail>
</Styled.ShowInfo>
</Styled.ShowCard>
))}
</Styled.ShowList>
</Styled.Section>
)}

<Styled.Divider />

{profile.performedShow.isVisible && profile.performedShow.totalSize > 0 && (
<Styled.PastShowSection>
<Styled.PastSectionHeader>
<Styled.SectionTitle>지난 공연</Styled.SectionTitle>
{profile.performedShow.hasMoreItems && (
<Styled.ViewAllButton onClick={() => navigate('shows')}>
전체 보기
</Styled.ViewAllButton>
)}
</Styled.PastSectionHeader>
<Styled.PastShowSlider spaceBetween={16} slidesPerView={'auto'}>
{profile.performedShow.previewItems.map((show) => (
<SwiperSlide key={show.id}>
<Styled.PastShowCard
<Styled.ContentSection>
{profile.comingSoonShow.isVisible && profile.comingSoonShow.totalSize > 0 && (
<Styled.Section>
<Styled.SectionHeader>
<Styled.SectionTitle>다가오는 공연</Styled.SectionTitle>
</Styled.SectionHeader>
<Styled.ShowList>
{profile.comingSoonShow.previewItems.map((show) => (
<Styled.ShowCard
key={show.id}
href={EXTERNAL_URL.SHOW_MANAGER_INFO(show.id)}
target="_blank"
rel="noopener noreferrer"
>
<Styled.PastShowImage src={show.showImg} alt={show.name} />
<Styled.PastShowTitle>
{show.name.length > 10 ? `${show.name.slice(0, 10)}...` : show.name}
</Styled.PastShowTitle>
<Styled.PastShowDate>{formatDateWithWeekday(show.date)}</Styled.PastShowDate>
</Styled.PastShowCard>
</SwiperSlide>
))}
</Styled.PastShowSlider>
</Styled.PastShowSection>
)}
<Styled.ShowImage src={show.showImg} alt={show.name} />
<Styled.ShowInfo>
<Styled.ShowTitle>{show.name}</Styled.ShowTitle>
<Styled.ShowDetail>{formatDateTimeWithWeekday(show.date)}</Styled.ShowDetail>
</Styled.ShowInfo>
</Styled.ShowCard>
))}
</Styled.ShowList>
</Styled.Section>
)}

<Styled.Divider />
<Styled.Divider />

{profile.video.totalSize > 0 && (
<Styled.Section>
<Styled.SectionHeader>
<Styled.SectionTitle>동영상</Styled.SectionTitle>
{profile.video.hasMoreItems && (
<Styled.ViewAllButton onClick={() => navigate('videos')}>
전체 보기
</Styled.ViewAllButton>
)}
</Styled.SectionHeader>
<Styled.VideoList>
{profile.video.previewItems.map((videoUrl) => (
<VideoCard key={videoUrl} videoUrl={videoUrl} />
))}
</Styled.VideoList>
</Styled.Section>
)}
{profile.performedShow.isVisible && profile.performedShow.totalSize > 0 && (
<Styled.PastShowSection>
<Styled.PastSectionHeader>
<Styled.SectionTitle>지난 공연</Styled.SectionTitle>
{profile.performedShow.hasMoreItems && (
<Styled.ViewAllButton onClick={() => navigate('shows')}>
전체 보기
</Styled.ViewAllButton>
)}
</Styled.PastSectionHeader>
<Styled.PastShowSlider spaceBetween={16} slidesPerView={'auto'}>
{profile.performedShow.previewItems.map((show) => (
<SwiperSlide key={show.id}>
<Styled.PastShowCard
href={EXTERNAL_URL.SHOW_MANAGER_INFO(show.id)}
target="_blank"
rel="noopener noreferrer"
>
<Styled.PastShowImage src={show.showImg} alt={show.name} />
<Styled.PastShowTitle>
{show.name.length > 10 ? `${show.name.slice(0, 10)}...` : show.name}
</Styled.PastShowTitle>
<Styled.PastShowDate>{formatDateWithWeekday(show.date)}</Styled.PastShowDate>
</Styled.PastShowCard>
</SwiperSlide>
))}
</Styled.PastShowSlider>
</Styled.PastShowSection>
)}

<Styled.Divider />
<Styled.Divider />

{profile.link.totalSize > 0 && (
<Styled.Section>
<Styled.SectionHeader>
<Styled.SectionTitle>링크</Styled.SectionTitle>
{profile.link.hasMoreItems && (
<Styled.ViewAllButton onClick={() => navigate('links')}>
전체 보기
</Styled.ViewAllButton>
)}
</Styled.SectionHeader>
<Styled.LinkList>
{profile.link.previewItems.map((link, index) => (
<Styled.LinkItem
key={`${link.link}-${index}`}
href={link.link}
target="_blank"
rel="noopener noreferrer"
>
<ChainLink />
<Styled.LinkTitle>{link.title}</Styled.LinkTitle>
</Styled.LinkItem>
))}
</Styled.LinkList>
</Styled.Section>
)}
{profile.video.totalSize > 0 && (
<Styled.Section>
<Styled.SectionHeader>
<Styled.SectionTitle>동영상</Styled.SectionTitle>
{profile.video.hasMoreItems && (
<Styled.ViewAllButton onClick={() => navigate('videos')}>
전체 보기
</Styled.ViewAllButton>
)}
</Styled.SectionHeader>
<Styled.VideoList>
{profile.video.previewItems.map((videoUrl) => (
<VideoCard key={videoUrl} videoUrl={videoUrl} />
))}
</Styled.VideoList>
</Styled.Section>
)}

<Styled.Divider />

{profile.link.totalSize > 0 && (
<Styled.Section>
<Styled.SectionHeader>
<Styled.SectionTitle>링크</Styled.SectionTitle>
{profile.link.hasMoreItems && (
<Styled.ViewAllButton onClick={() => navigate('links')}>
전체 보기
</Styled.ViewAllButton>
)}
</Styled.SectionHeader>
<Styled.LinkList>
{profile.link.previewItems.map((link, index) => (
<Styled.LinkItem
key={`${link.link}-${index}`}
href={link.link}
target="_blank"
rel="noopener noreferrer"
>
<ChainLink />
<Styled.LinkTitle>{link.title}</Styled.LinkTitle>
</Styled.LinkItem>
))}
</Styled.LinkList>
</Styled.Section>
)}
</Styled.ContentSection>

<Styled.BottomCTA>
<Styled.CTAButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const Title = styled.p`
color: #f6f7ff;
margin: 0;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
`;

const Duration = styled.p`
Expand Down
1 change: 1 addition & 0 deletions apps/profile/src/pages/ProfileVideosPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const ProfileVideosPage = () => {

const VideoItem = ({ videoUrl }: VideoItemProps) => {
const videoId = getYoutubeVideoId(videoUrl);

const thumbnailUrl = videoId ? getYoutubeThumbnailUrl(videoId) : null;
const { data } = useYoutubeVideoDuration(videoId);
const formattedDuration = formatYoutubeDuration(data?.duration ?? null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const MenuItem = styled.button`
padding: 17px 0;
background: none;
border: none;
${({ theme }) => theme.typo.sh1};
${({ theme }) => theme.typo.b3};
color: ${({ theme }) => theme.palette.mobile.grey.g10};
text-align: left;
cursor: pointer;
Expand Down
Loading
Loading