-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into publish
- Loading branch information
Showing
11 changed files
with
106 additions
and
76 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
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,22 +1,23 @@ | ||
import React from "react"; | ||
import { ReactComponent as CheckIcon } from "../../../images/icons/check.svg"; | ||
import { ReactComponent as CrossIcon } from "../../../images/icons/cross.svg"; | ||
|
||
function Icon({ iconName }: { iconName: string }) { | ||
let IconComponent: SvgComponent; | ||
let iconColor = "currentColor"; | ||
|
||
switch (iconName) { | ||
case "check": | ||
IconComponent = CheckIcon; | ||
break; | ||
case "cross": | ||
IconComponent = CrossIcon; | ||
iconColor = "#CB2431"; | ||
break; | ||
default: | ||
return <></>; | ||
} | ||
|
||
return <IconComponent />; | ||
return <IconComponent height={16} color={iconColor} />; | ||
} | ||
|
||
export default Icon; |
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,8 @@ | ||
export interface YouTubeProps { | ||
className?: string; | ||
videoId: string; | ||
start?: string; | ||
end?: string; | ||
height?: string; | ||
width?: string; | ||
} |
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,59 +1,28 @@ | ||
import classNames from "classnames"; | ||
import { YouTubeProps } from "./Youtube.interface"; | ||
import styles from "./Youtube.module.css"; | ||
|
||
interface YouTubeProps { | ||
videoId: string; | ||
start?: string; | ||
end?: string; | ||
caption?: string; | ||
height?: string; | ||
width?: string; | ||
} | ||
|
||
const YouTube = ({ | ||
caption = "", | ||
className = "", | ||
videoId, | ||
start = "", | ||
end = "", | ||
height, | ||
width, | ||
}: YouTubeProps) => { | ||
let YouTubeBlock; | ||
|
||
if (caption) { | ||
YouTubeBlock = ( | ||
<section className={styles.Container}> | ||
<section className={styles.IframeContainer}> | ||
<iframe | ||
allowFullScreen | ||
src={`https://www.youtube-nocookie.com/embed/${videoId}?rel=0&start=${start}&end=${end}&rel=0`} | ||
className={styles.Iframe} | ||
title="YouTube video player" | ||
frameBorder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" | ||
style={{ height, width }} | ||
></iframe> | ||
</section> | ||
<section className={styles.CaptionContainer}> | ||
<p className={styles.Caption}>{caption}</p> | ||
</section> | ||
</section> | ||
); | ||
} else { | ||
YouTubeBlock = ( | ||
<section className={styles.IframeContainer} style={{ height, width }}> | ||
<iframe | ||
allowFullScreen | ||
src={`https://www.youtube-nocookie.com/embed/${videoId}?rel=0&start=${start}&end=${end}&rel=0`} | ||
className={styles.Iframe} | ||
title="YouTube video player" | ||
frameBorder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" | ||
style={{ height, width }} | ||
></iframe> | ||
</section> | ||
); | ||
} | ||
return YouTubeBlock; | ||
return ( | ||
<div className={classNames(styles.Container, className)}> | ||
<iframe | ||
allowFullScreen | ||
src={`https://www.youtube-nocookie.com/embed/${videoId}?rel=0&start=${start}&end=${end}&rel=0`} | ||
className={styles.Iframe} | ||
title="YouTube video player" | ||
frameBorder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" | ||
style={{ height, width }} | ||
></iframe> | ||
</div> | ||
); | ||
}; | ||
|
||
export default YouTube; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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