From ee1bab191ff8c357bc9386fc0b022ca4bce6c474 Mon Sep 17 00:00:00 2001 From: Guusvanmeerveld Date: Mon, 21 Mar 2022 21:59:19 +0100 Subject: [PATCH] Added trending page --- .prettierrc.json | 1 + src/components/Video/Grid.tsx | 25 ++++++++++++++++++++++ src/components/Video/index.tsx | 38 +++++++++++++++++++++++++++++++++ src/interfaces/video.ts | 6 ++++++ src/pages/trending.tsx | 39 ++++++++++++++++++++++++++++++++++ tsconfig.json | 1 + 6 files changed, 110 insertions(+) create mode 100644 src/components/Video/Grid.tsx create mode 100644 src/components/Video/index.tsx create mode 100644 src/interfaces/video.ts create mode 100644 src/pages/trending.tsx diff --git a/.prettierrc.json b/.prettierrc.json index cf4f856..dfd80d9 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -14,6 +14,7 @@ "^@mui/.*", "^@src/.*", "^@models/.*", + "^@interfaces/.*", "^@utils/.*", "^@components/.*", ".*sass$", diff --git a/src/components/Video/Grid.tsx b/src/components/Video/Grid.tsx new file mode 100644 index 0000000..69cd594 --- /dev/null +++ b/src/components/Video/Grid.tsx @@ -0,0 +1,25 @@ +import { FC } from "react"; + +import { Grid } from "@mui/material"; + +import { Video as VideoModel } from "@interfaces/video"; + +import Video from "@components/Video"; + +const VideoGrid: FC<{ videos: VideoModel[] }> = ({ videos }) => { + return ( + + {videos.map((video) => ( + + + ))} + + ); +}; + +export default VideoGrid; diff --git a/src/components/Video/index.tsx b/src/components/Video/index.tsx new file mode 100644 index 0000000..ffc322e --- /dev/null +++ b/src/components/Video/index.tsx @@ -0,0 +1,38 @@ +import { useRouter } from "next/router"; + +import { FC } from "react"; + +import Card from "@mui/material/Card"; +import CardActionArea from "@mui/material/CardActionArea"; +import CardContent from "@mui/material/CardContent"; +import CardMedia from "@mui/material/CardMedia"; +import Typography from "@mui/material/Typography"; + +import { Video } from "@interfaces/video"; + +const Video: FC