From 8fb529d21cb1a76686e1ca02e7f2f22f12e2a10a Mon Sep 17 00:00:00 2001 From: Guusvanmeerveld Date: Thu, 24 Mar 2022 18:44:18 +0100 Subject: [PATCH] Reworked interface folder, added fetching to /watch --- .github/workflows/deploy.yml | 2 +- Dockerfile | 2 +- src/components/Loading.tsx | 19 ++++ src/components/Navbar/index.tsx | 15 +-- src/components/Video/index.tsx | 10 +- src/interfaces/{ => api}/channel.ts | 12 ++- src/interfaces/{api.ts => api/index.ts} | 0 src/interfaces/api/trending.ts | 27 +++++ src/interfaces/api/video.ts | 129 ++++++++++++++++++++++++ src/interfaces/video.ts | 57 ++++++----- src/pages/_app.tsx | 4 +- src/pages/trending.tsx | 69 +++++-------- src/pages/watch.tsx | 54 +++++++++- src/utils/conversions.ts | 54 +++++++++- 14 files changed, 362 insertions(+), 92 deletions(-) create mode 100644 src/components/Loading.tsx rename src/interfaces/{ => api}/channel.ts (82%) rename src/interfaces/{api.ts => api/index.ts} (100%) create mode 100644 src/interfaces/api/trending.ts create mode 100644 src/interfaces/api/video.ts diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d9d81a6..c230ac0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy to Github Pages +name: Deploy to Github Pages / Docker hub on: push: diff --git a/Dockerfile b/Dockerfile index c081bac..87863f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ COPY . . COPY --from=deps /app/node_modules ./node_modules ENV NEXT_TELEMETRY_DISABLED 1; -ENV NODE_ENV production; +ENV NODE_ENV "production" RUN yarn export diff --git a/src/components/Loading.tsx b/src/components/Loading.tsx new file mode 100644 index 0000000..760e9ce --- /dev/null +++ b/src/components/Loading.tsx @@ -0,0 +1,19 @@ +import { FC } from "react"; + +import Box from "@mui/material/Box"; +import CircularProgress from "@mui/material/CircularProgress"; + +const Loading: FC = () => ( + + + +); + +export default Loading; diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index daa1f40..b66309f 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -47,21 +47,21 @@ const Navbar: FC = () => { }; const pages = [ - { name: "Trending", icon: , link: "trending" }, + { name: "Trending", icon: , link: "/trending" }, { name: "Subscriptions", icon: , - link: "subscriptions" + link: "/subscriptions" }, { name: "Watch History", icon: , - link: "history" + link: "/history" }, { name: "Playlists", icon: , - link: "playlists" + link: "/playlists" } ]; @@ -81,7 +81,10 @@ const Navbar: FC = () => { edge="start" color="inherit" aria-label="menu" - sx={{ mr: 2, display: { lg: "none", xs: "flex" } }} + sx={{ + mr: { md: 2, xs: 0 }, + display: { lg: "none", xs: "flex" } + }} onClick={() => setDrawerState(!drawerIsOpen)} > @@ -104,7 +107,7 @@ const Navbar: FC = () => { }} > {pages.map((page, i) => ( - +