Skip to content

Commit 56fd416

Browse files
committed
fix: 2줄 처리 완료
1 parent d115cd4 commit 56fd416

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

apps/profile/src/components/VideoCard/VideoCard.styles.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ const VideoCard = styled.a`
77
`;
88

99
const VideoThumbnailWrapper = styled.div`
10-
position: relative;
10+
width: 160px;
11+
height: 90px;
12+
border-radius: 4px;
13+
overflow: hidden;
14+
gap: 6px;
15+
background-color: ${({ theme }) => theme.palette.mobile.grey.g80};
16+
flex-shrink: 0;
17+
display: flex;
18+
align-items: center;
19+
justify-content: center;
20+
border: 1px solid #2e303a;
1121
`;
1222

1323
const VideoInfo = styled.div`
@@ -36,6 +46,13 @@ const VideoThumbnail = styled.img`
3646
const VideoTitle = styled.p`
3747
${({ theme }) => theme.typo.sh1};
3848
color: #f6f7ff;
49+
margin: 0;
50+
display: -webkit-box;
51+
-webkit-line-clamp: 2;
52+
-webkit-box-orient: vertical;
53+
overflow: hidden;
54+
text-overflow: ellipsis;
55+
word-break: break-word;
3956
`;
4057

4158
export default {

apps/profile/src/components/VideoCard/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useYoutubeVideoDuration } from '@boolti/api';
22
import { formatYoutubeDuration, getYoutubeThumbnailUrl, getYoutubeVideoId } from '~/utils';
33
import Styled from './VideoCard.styles';
4+
import { BooltiDarkIcon, BooltiDarkLogo } from '@boolti/icon';
45

56
interface VideoCardProps {
67
videoUrl: string;
@@ -9,12 +10,21 @@ interface VideoCardProps {
910
const VideoCard = ({ videoUrl }: VideoCardProps) => {
1011
const videoId = getYoutubeVideoId(videoUrl) as string;
1112
const { data } = useYoutubeVideoDuration(videoId);
13+
const thumbnailUrl = videoId ? getYoutubeThumbnailUrl(videoId) : null;
14+
1215
const formattedDuration = formatYoutubeDuration(data?.duration ?? null);
1316

1417
return (
1518
<Styled.VideoCard href={videoUrl} target="_blank" rel="noopener noreferrer">
1619
<Styled.VideoThumbnailWrapper>
17-
<Styled.VideoThumbnail src={getYoutubeThumbnailUrl(videoId)} alt="YouTube video" />
20+
{thumbnailUrl ? (
21+
<Styled.VideoThumbnail src={thumbnailUrl} alt="YouTube video" />
22+
) : (
23+
<>
24+
<BooltiDarkIcon />
25+
<BooltiDarkLogo />
26+
</>
27+
)}
1828
</Styled.VideoThumbnailWrapper>
1929
<Styled.VideoInfo>
2030
<Styled.VideoTitle>{data?.title ?? '알 수 없는 동영상'}</Styled.VideoTitle>

apps/profile/src/pages/ProfileVideosPage/ProfileVideosPage.styles.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ const Title = styled.p`
4545
color: #f6f7ff;
4646
margin: 0;
4747
line-height: 1.4;
48+
display: -webkit-box;
49+
-webkit-line-clamp: 2;
50+
-webkit-box-orient: vertical;
51+
overflow: hidden;
52+
text-overflow: ellipsis;
53+
word-break: break-word;
4854
`;
4955

5056
const Duration = styled.p`

0 commit comments

Comments
 (0)