Skip to content

Commit

Permalink
Merge pull request #133 from prgrms-fe-devcourse/119-feature/ptrailer…
Browse files Browse the repository at this point in the history
…desc-component

Feat: PTrailerDesc 컴포넌트 구현
  • Loading branch information
thsk3 authored Oct 2, 2024
2 parents 0a8f598 + b09694a commit 03ff8c2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/PTrailerDesc/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Poster } from '@/components/Poster';
import * as S from './styles';
import { P16 } from '@/components/Text';

interface PTrailerDescProps {
src: string;
videoTitle: string;
width?: string;
}

export const PTrailerDesc = ({ src, videoTitle, width = '100%' }: PTrailerDescProps) => {
return (
<S.PTrailerDesc width={width}>
<Poster src={src} width="50px"></Poster>
<P16>{videoTitle}</P16>
</S.PTrailerDesc>
);
};
25 changes: 25 additions & 0 deletions src/components/PTrailerDesc/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { styled } from 'styled-components';

export const PTrailerDesc = styled.div<{ width: string }>`
width: ${({ width }) => width};
display: flex;
align-items: center;
padding: 1rem;
border: 1px solid ${({ theme }) => theme.colors.gray};
border-radius: 1rem;
& > div {
border-radius: 0.5rem;
overflow: hidden;
flex-shrink: 0;
}
& > p {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
padding-left: 1rem;
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
}
`;

0 comments on commit 03ff8c2

Please sign in to comment.