From 35631ddc4fb2642357cce3541c65c1560b18f45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Tue, 24 Sep 2024 16:48:29 +0200 Subject: [PATCH 1/7] deploy fix --- client/package.json | 2 +- client/src/containers/welcome-message/index.tsx | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/client/package.json b/client/package.json index a127bee3..fef0f63a 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "ccsa-client", - "version": "0.2.0", + "version": "1.0.0", "private": true, "scripts": { "dev": "yarn types && next dev", diff --git a/client/src/containers/welcome-message/index.tsx b/client/src/containers/welcome-message/index.tsx index 45e15306..373a06b4 100644 --- a/client/src/containers/welcome-message/index.tsx +++ b/client/src/containers/welcome-message/index.tsx @@ -83,9 +83,7 @@ export default function WelcomeMessage() { {data?.data?.attributes?.image && ( Welcome message setPlaying(true)} onPause={() => setPlaying(false)} controls - // TO DO - get URL dynamically - // url={`${env.NEXT_PUBLIC_CMS_URL}${data?.data?.attributes?.video?.data?.attributes?.url}`} - url="https://ccsa-staging-assets-bucket.s3.amazonaws.com/SID_4_Pre_Event_MAP_Video_4f0cdbfa51.mp4" + url={`${data?.data?.attributes?.video?.data?.attributes?.url}`} width={"100%"} height={"100%"} /> From 5e3b6b7b27903bb1ff2cf8b84a534b8e0063edbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Tue, 24 Sep 2024 16:48:29 +0200 Subject: [PATCH 2/7] deploy fix --- client/package.json | 2 +- client/src/containers/welcome-message/index.tsx | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/client/package.json b/client/package.json index a127bee3..fef0f63a 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "ccsa-client", - "version": "0.2.0", + "version": "1.0.0", "private": true, "scripts": { "dev": "yarn types && next dev", diff --git a/client/src/containers/welcome-message/index.tsx b/client/src/containers/welcome-message/index.tsx index 45e15306..373a06b4 100644 --- a/client/src/containers/welcome-message/index.tsx +++ b/client/src/containers/welcome-message/index.tsx @@ -83,9 +83,7 @@ export default function WelcomeMessage() { {data?.data?.attributes?.image && ( Welcome message setPlaying(true)} onPause={() => setPlaying(false)} controls - // TO DO - get URL dynamically - // url={`${env.NEXT_PUBLIC_CMS_URL}${data?.data?.attributes?.video?.data?.attributes?.url}`} - url="https://ccsa-staging-assets-bucket.s3.amazonaws.com/SID_4_Pre_Event_MAP_Video_4f0cdbfa51.mp4" + url={`${data?.data?.attributes?.video?.data?.attributes?.url}`} width={"100%"} height={"100%"} /> From 5d112c38f61599876526ec464af6c629ad2eb7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Tue, 1 Oct 2024 14:24:21 +0200 Subject: [PATCH 3/7] viweport update --- .vscode/settings.json | 3 +++ client/src/app/(auth)/signin/page.tsx | 1 + client/src/app/(auth)/signup/page.tsx | 1 + .../src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx | 1 + .../app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx | 1 + .../dashboard/datasets/changes-to-approve/[id]/page.tsx | 1 + .../src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx | 1 + client/src/app/(dashboard)/dashboard/datasets/new/page.tsx | 1 + .../app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx | 1 + .../src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx | 1 + client/src/app/(password)/reset-password/page.tsx | 1 + client/src/app/(password)/update-password/page.tsx | 3 ++- client/src/app/layout.tsx | 1 + 13 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..a3c03d68 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["sdgs"] +} diff --git a/client/src/app/(auth)/signin/page.tsx b/client/src/app/(auth)/signin/page.tsx index b2021344..1809848b 100644 --- a/client/src/app/(auth)/signin/page.tsx +++ b/client/src/app/(auth)/signin/page.tsx @@ -5,6 +5,7 @@ import Signin from "@/components/forms/signin"; export const metadata: Metadata = { title: "Sign in | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function SigninPage() { diff --git a/client/src/app/(auth)/signup/page.tsx b/client/src/app/(auth)/signup/page.tsx index d0b2a91f..3484de72 100644 --- a/client/src/app/(auth)/signup/page.tsx +++ b/client/src/app/(auth)/signup/page.tsx @@ -5,6 +5,7 @@ import Signup from "@/components/forms/signup"; export const metadata: Metadata = { title: "Sign up | Caribbean Climate smart map", description: "Caribbean Climate smart map", + viewport: "width=1000, initial-scale=1", }; export default function SignupPage() { diff --git a/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx index 4b98f4de..6a681317 100644 --- a/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx @@ -5,6 +5,7 @@ import DashboardContent from "@/containers/dashboard"; export const metadata: Metadata = { title: "Dashboard | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function DashboardPage() { diff --git a/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx index 08fd1c18..340ec358 100644 --- a/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx @@ -5,6 +5,7 @@ import CollaboratorsForm from "@/containers/collaborators/form"; export const metadata: Metadata = { title: "Create new collaborator | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function CollaboratorPage() { diff --git a/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx b/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx index e370e2c0..9ba5b3b8 100644 --- a/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx @@ -28,6 +28,7 @@ import { export const metadata: Metadata = { title: "Changes to approve | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default async function ChangesToApprovePage({ params }: { params: { id: number } }) { diff --git a/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx b/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx index 689a8202..89d23475 100644 --- a/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx @@ -23,6 +23,7 @@ import { export const metadata: Metadata = { title: "Edit dataset form | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default async function EditDatasetPage({ params }: { params: { id: number } }) { diff --git a/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx b/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx index 143a7e2f..7070b588 100644 --- a/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx +++ b/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx @@ -16,6 +16,7 @@ import { export const metadata: Metadata = { title: "New dataset form | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function NewDatasetPage() { diff --git a/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx index d59149d6..822e1435 100644 --- a/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx @@ -5,6 +5,7 @@ import ToolForm from "@/containers/other-tools/form"; export const metadata: Metadata = { title: "Create / edit a tool | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function OtherToolsFormPage() { diff --git a/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx index e21f9c66..3905b40e 100644 --- a/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx @@ -5,6 +5,7 @@ import ProjectForm from "@/containers/projects/form"; export const metadata: Metadata = { title: "Create / edit a project | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function NewProjectsPage() { diff --git a/client/src/app/(password)/reset-password/page.tsx b/client/src/app/(password)/reset-password/page.tsx index b465ea26..bdd9391a 100644 --- a/client/src/app/(password)/reset-password/page.tsx +++ b/client/src/app/(password)/reset-password/page.tsx @@ -5,6 +5,7 @@ import ResetPassword from "@/components/forms/reset-password"; export const metadata: Metadata = { title: "Reset Password | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function ResetPasswordPage() { diff --git a/client/src/app/(password)/update-password/page.tsx b/client/src/app/(password)/update-password/page.tsx index 936de8b1..8598ac50 100644 --- a/client/src/app/(password)/update-password/page.tsx +++ b/client/src/app/(password)/update-password/page.tsx @@ -3,8 +3,9 @@ import { Metadata } from "next"; import PasswordUpdate from "@/components/forms/password-update"; export const metadata: Metadata = { - title: "Reset Password | Caribbean Climate smart map", + title: "Update Password | Caribbean Climate smart map", description: "Generated by create next app", + viewport: "width=1000, initial-scale=1", }; export default function UpdatePasswordPage() { diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx index 0f819bd0..37204acc 100644 --- a/client/src/app/layout.tsx +++ b/client/src/app/layout.tsx @@ -29,6 +29,7 @@ import LayoutProviders from "./layout-providers"; export const metadata: Metadata = { title: { template: "%s | CCSA", default: "CCSA" }, description: "Caribbean Climate smart map", + viewport: "width=1000, initial-scale=1", }; export default async function RootLayout({ children }: PropsWithChildren) { From 0ecd7edb3c2034d0a9fcdb406b02e68d5c64877e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Wed, 2 Oct 2024 11:36:51 +0200 Subject: [PATCH 4/7] viewport change --- client/src/app/(auth)/signin/page.tsx | 8 ++++++-- client/src/app/(auth)/signup/page.tsx | 8 ++++++-- .../(dashboard)/dashboard/(profile)/[[...id]]/page.tsx | 8 ++++++-- .../dashboard/collaborators/[[...id]]/page.tsx | 8 ++++++-- .../dashboard/datasets/changes-to-approve/[id]/page.tsx | 8 ++++++-- .../(dashboard)/dashboard/datasets/edit/[id]/page.tsx | 9 ++++++--- .../src/app/(dashboard)/dashboard/datasets/new/page.tsx | 8 ++++++-- .../(dashboard)/dashboard/other-tools/[[...id]]/page.tsx | 8 ++++++-- .../(dashboard)/dashboard/projects/[[...id]]/page.tsx | 8 ++++++-- client/src/app/(password)/reset-password/page.tsx | 8 ++++++-- client/src/app/(password)/update-password/page.tsx | 8 ++++++-- client/src/app/layout.tsx | 8 ++++++-- client/src/components/forms/dataset/colors.tsx | 2 +- 13 files changed, 73 insertions(+), 26 deletions(-) diff --git a/client/src/app/(auth)/signin/page.tsx b/client/src/app/(auth)/signin/page.tsx index 1809848b..956fc984 100644 --- a/client/src/app/(auth)/signin/page.tsx +++ b/client/src/app/(auth)/signin/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import Signin from "@/components/forms/signin"; export const metadata: Metadata = { title: "Sign in | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function SigninPage() { diff --git a/client/src/app/(auth)/signup/page.tsx b/client/src/app/(auth)/signup/page.tsx index 3484de72..796f9d82 100644 --- a/client/src/app/(auth)/signup/page.tsx +++ b/client/src/app/(auth)/signup/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import Signup from "@/components/forms/signup"; export const metadata: Metadata = { title: "Sign up | Caribbean Climate smart map", description: "Caribbean Climate smart map", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function SignupPage() { diff --git a/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx index 6a681317..981e84e6 100644 --- a/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/(profile)/[[...id]]/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import DashboardContent from "@/containers/dashboard"; export const metadata: Metadata = { title: "Dashboard | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function DashboardPage() { diff --git a/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx index 340ec358..98387d83 100644 --- a/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/collaborators/[[...id]]/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import CollaboratorsForm from "@/containers/collaborators/form"; export const metadata: Metadata = { title: "Create new collaborator | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function CollaboratorPage() { diff --git a/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx b/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx index 9ba5b3b8..4752f542 100644 --- a/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/datasets/changes-to-approve/[id]/page.tsx @@ -1,4 +1,4 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import Link from "next/link"; @@ -28,7 +28,11 @@ import { export const metadata: Metadata = { title: "Changes to approve | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default async function ChangesToApprovePage({ params }: { params: { id: number } }) { diff --git a/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx b/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx index 89d23475..8eecd61d 100644 --- a/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/datasets/edit/[id]/page.tsx @@ -1,5 +1,4 @@ -import { Metadata } from "next"; - +import { Metadata, Viewport } from "next"; import Link from "next/link"; import { Hydrate, dehydrate } from "@tanstack/react-query"; @@ -23,7 +22,11 @@ import { export const metadata: Metadata = { title: "Edit dataset form | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default async function EditDatasetPage({ params }: { params: { id: number } }) { diff --git a/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx b/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx index 7070b588..83389a96 100644 --- a/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx +++ b/client/src/app/(dashboard)/dashboard/datasets/new/page.tsx @@ -1,4 +1,4 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import Link from "next/link"; @@ -16,7 +16,11 @@ import { export const metadata: Metadata = { title: "New dataset form | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function NewDatasetPage() { diff --git a/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx index 822e1435..c2685ffe 100644 --- a/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/other-tools/[[...id]]/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import ToolForm from "@/containers/other-tools/form"; export const metadata: Metadata = { title: "Create / edit a tool | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function OtherToolsFormPage() { diff --git a/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx b/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx index 3905b40e..01f335dd 100644 --- a/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx +++ b/client/src/app/(dashboard)/dashboard/projects/[[...id]]/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import ProjectForm from "@/containers/projects/form"; export const metadata: Metadata = { title: "Create / edit a project | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function NewProjectsPage() { diff --git a/client/src/app/(password)/reset-password/page.tsx b/client/src/app/(password)/reset-password/page.tsx index bdd9391a..54b86128 100644 --- a/client/src/app/(password)/reset-password/page.tsx +++ b/client/src/app/(password)/reset-password/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import ResetPassword from "@/components/forms/reset-password"; export const metadata: Metadata = { title: "Reset Password | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function ResetPasswordPage() { diff --git a/client/src/app/(password)/update-password/page.tsx b/client/src/app/(password)/update-password/page.tsx index 8598ac50..2d1309b5 100644 --- a/client/src/app/(password)/update-password/page.tsx +++ b/client/src/app/(password)/update-password/page.tsx @@ -1,11 +1,15 @@ -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import PasswordUpdate from "@/components/forms/password-update"; export const metadata: Metadata = { title: "Update Password | Caribbean Climate smart map", description: "Generated by create next app", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default function UpdatePasswordPage() { diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx index 37204acc..2dfacff2 100644 --- a/client/src/app/layout.tsx +++ b/client/src/app/layout.tsx @@ -6,7 +6,7 @@ import { PropsWithChildren } from "react"; import { ToastContainer } from "react-toastify"; -import type { Metadata } from "next"; +import type { Metadata, Viewport } from "next"; import { GoogleAnalytics } from "@next/third-parties/google"; import { Hydrate, dehydrate } from "@tanstack/react-query"; @@ -29,7 +29,11 @@ import LayoutProviders from "./layout-providers"; export const metadata: Metadata = { title: { template: "%s | CCSA", default: "CCSA" }, description: "Caribbean Climate smart map", - viewport: "width=1000, initial-scale=1", +}; + +export const viewport: Viewport = { + width: 1000, + initialScale: 1, }; export default async function RootLayout({ children }: PropsWithChildren) { diff --git a/client/src/components/forms/dataset/colors.tsx b/client/src/components/forms/dataset/colors.tsx index 4f58792c..5ae5ebf8 100644 --- a/client/src/components/forms/dataset/colors.tsx +++ b/client/src/components/forms/dataset/colors.tsx @@ -333,7 +333,7 @@ export default function DatasetColorsForm({ ), })} onChange={(e) => { - return field.onChange(e.target.value); + return field.onChange(e?.target?.value); }} disabled={status === "declined" && ME_DATA?.role?.type !== "admin"} /> From 5fc4edae6efa7fd934c529f385ee0d5a3494d361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Wed, 2 Oct 2024 13:01:29 +0200 Subject: [PATCH 5/7] on change fullscreen --- client/src/containers/welcome-message/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/containers/welcome-message/index.tsx b/client/src/containers/welcome-message/index.tsx index 373a06b4..1815ff72 100644 --- a/client/src/containers/welcome-message/index.tsx +++ b/client/src/containers/welcome-message/index.tsx @@ -37,18 +37,18 @@ export default function WelcomeMessage() { const handlePlay = () => { if (!videoRefContainer.current) return; setPlaying((prev) => !prev); - screenfull.request(videoRefContainer.current); + screenfull?.request(videoRefContainer?.current); }; const handleFullscreen = () => { - setFullscreen(screenfull.isFullscreen); + setFullscreen(screenfull?.isFullscreen); }; useEffect(() => { - screenfull.on("change", handleFullscreen); + screenfull?.on("change", handleFullscreen); return () => { - screenfull.off("change", handleFullscreen); + screenfull?.off("change", handleFullscreen); }; }, []); From a89fc802cbe23dc224b1dc46dae44c85755dd659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Wed, 2 Oct 2024 13:22:45 +0200 Subject: [PATCH 6/7] test - on change fullscreen --- client/src/containers/welcome-message/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/containers/welcome-message/index.tsx b/client/src/containers/welcome-message/index.tsx index 1815ff72..8650af02 100644 --- a/client/src/containers/welcome-message/index.tsx +++ b/client/src/containers/welcome-message/index.tsx @@ -44,13 +44,13 @@ export default function WelcomeMessage() { setFullscreen(screenfull?.isFullscreen); }; - useEffect(() => { - screenfull?.on("change", handleFullscreen); + // useEffect(() => { + // screenfull?.on("change", handleFullscreen); - return () => { - screenfull?.off("change", handleFullscreen); - }; - }, []); + // return () => { + // screenfull?.off("change", handleFullscreen); + // }; + // }, []); return ( From 338729d96ddfe5413babb3a0ddde43eb70812e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Wed, 2 Oct 2024 18:50:32 +0200 Subject: [PATCH 7/7] empty fullscreen fix --- .../src/containers/welcome-message/index.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/client/src/containers/welcome-message/index.tsx b/client/src/containers/welcome-message/index.tsx index 8650af02..87662b55 100644 --- a/client/src/containers/welcome-message/index.tsx +++ b/client/src/containers/welcome-message/index.tsx @@ -2,6 +2,8 @@ import { useEffect, useRef, useState } from "react"; +import isEmpty from "lodash-es/isEmpty"; + import { useCookies } from "react-cookie"; import ReactPlayer from "react-player"; @@ -10,8 +12,6 @@ import Image from "next/image"; import { LuPlay } from "react-icons/lu"; import screenfull from "screenfull"; -import env from "@/env.mjs"; - import { cn } from "@/lib/classnames"; import { useGetWelcomeMessage } from "@/types/generated/welcome-message"; @@ -43,14 +43,15 @@ export default function WelcomeMessage() { const handleFullscreen = () => { setFullscreen(screenfull?.isFullscreen); }; - - // useEffect(() => { - // screenfull?.on("change", handleFullscreen); - - // return () => { - // screenfull?.off("change", handleFullscreen); - // }; - // }, []); + useEffect(() => { + if (!isEmpty(screenfull)) { + screenfull?.on("change", handleFullscreen); + + return () => { + screenfull?.off("change", handleFullscreen); + }; + } + }, []); return (