-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from prgrms-fe-devcourse/120-feature/ptrailer…
…-component 120 feature/ptrailer component
- Loading branch information
Showing
5 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { PTrailerVideo } from '@/components/PTrailerVideo'; | ||
import { PTrailerDesc } from '@/components/PTrailerDesc'; | ||
import * as S from './styles'; | ||
|
||
interface PTrailerProps { | ||
postSrc: string; | ||
vId: string; | ||
vTitle: string; | ||
width?: string; | ||
} | ||
|
||
export const PTrailer = ({ postSrc, vId, vTitle, width = '100%' }: PTrailerProps) => { | ||
return ( | ||
<S.PTrailer width={width}> | ||
<PTrailerVideo vId={vId} /> | ||
<PTrailerDesc src={postSrc} vTitle={vTitle} /> | ||
</S.PTrailer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { styled } from 'styled-components'; | ||
|
||
export const PTrailer = styled.div<{ width: string }>` | ||
width: ${({ width }) => width}; | ||
border-radius: 1rem; | ||
overflow: hidden; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import * as S from './styles'; | ||
interface PTrailerVideoProps { | ||
src: string; | ||
vId: string; | ||
width?: string; | ||
} | ||
export const PTrailerVideo = ({ src, width = '100%' }: PTrailerVideoProps) => { | ||
export const PTrailerVideo = ({ vId, width = '100%' }: PTrailerVideoProps) => { | ||
return ( | ||
<S.PTrailerVideo width={width}> | ||
<iframe src={`https://www.youtube.com/embed/${src}`} /> | ||
<iframe src={`https://www.youtube.com/embed/${vId}`} /> | ||
</S.PTrailerVideo> | ||
); | ||
}; |