1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 07:01:19 -04:00

all components should accept additional classnames

This commit is contained in:
2022-01-20 12:06:05 -05:00
parent 2162e9d563
commit 7e37adabc1
22 changed files with 150 additions and 86 deletions

View File

@@ -1,3 +1,4 @@
import classNames from "classnames";
import ReactPlayer from "react-player/file";
import styles from "./Video.module.css";
@@ -8,9 +9,10 @@ type Props = {
thumbnail?: string;
subs?: string;
autoplay?: boolean;
className?: string;
};
const Video = ({ webm, mp4, thumbnail, subs, autoplay }: Props) => {
const Video = ({ webm, mp4, thumbnail, subs, autoplay, className, ...rest }: Props) => {
const url = [
webm && {
src: webm,
@@ -53,9 +55,9 @@ const Video = ({ webm, mp4, thumbnail, subs, autoplay }: Props) => {
}
return (
<div className={styles.wrapper}>
<div className={classNames(styles.wrapper, className)}>
{/* @ts-ignore */}
<ReactPlayer width="100%" height="100%" url={url} config={config} controls={!autoplay} />
<ReactPlayer width="100%" height="100%" url={url} config={config} controls={!autoplay} {...rest} />
</div>
);
};