-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hofix: 주변다른식당 클릭 이후 뒤로가기가 동작하지 않는 오류 개선 (#703)
* refactor: YoutubeEmbed 컴포넌트로 iframe 분리 - key props 적용 * refactor: YoutubeEmbed 컴포넌트 적용 * refactor: 페이지 라우팅 로직 변경 - window.location.href 방식에서 useNavigate 방식으로
- Loading branch information
1 parent
3bc7b4e
commit 87ef8ca
Showing
6 changed files
with
47 additions
and
32 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from 'styled-components'; | ||
import { BORDER_RADIUS, paintSkeleton } from '~/styles/common'; | ||
|
||
interface YoutubeEmbedProps { | ||
title: string; | ||
pathParam: string; | ||
} | ||
|
||
function YoutubeEmbed({ title, pathParam }: YoutubeEmbedProps) { | ||
return ( | ||
<StyledVideo | ||
key={pathParam} | ||
title={`${title}의 영상`} | ||
src={`https://www.youtube.com/embed/${pathParam}`} | ||
allow="encrypted-media; gyroscope; picture-in-picture" | ||
allowFullScreen | ||
/> | ||
); | ||
} | ||
|
||
export default YoutubeEmbed; | ||
|
||
const StyledVideo = styled.iframe` | ||
${paintSkeleton} | ||
border-radius: ${BORDER_RADIUS.md}; | ||
`; |
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,3 @@ | ||
import YoutubeEmbed from './YoutubeEmbed'; | ||
|
||
export default YoutubeEmbed; |
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