From 6586fd4fada584a99f84a268a2d5cb8206c70c8b Mon Sep 17 00:00:00 2001 From: YoanRos <98326747+YoanRos@users.noreply.github.com> Date: Fri, 22 Dec 2023 11:55:05 +0100 Subject: [PATCH] fix: popup download header icons (#96) * fix: popup download header icons * fix: index import --- components/Navigation.js | 8 ++++++-- pages/blog/[blog].js | 8 +++++--- pages/blog/index.js | 8 +++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/components/Navigation.js b/components/Navigation.js index 8b7ff1f..d6bcf29 100644 --- a/components/Navigation.js +++ b/components/Navigation.js @@ -101,10 +101,14 @@ const DownloadPopupTrigger = ({ setShowPopup }) => { export const DownloadPopup = ({ showPopup, setShowPopup }) => { const popupFirstFocus = useRef(null) + const [baseUrl, setBaseUrl] = useState("") useEffect(() => { // on popup open, focus on the first link popupFirstFocus.current.focus() + if (typeof window !== "undefined") { + setBaseUrl(window.location.origin) + } }, [showPopup]) return ( @@ -138,14 +142,14 @@ export const DownloadPopup = ({ showPopup, setShowPopup }) => { télécharger dans Google Play télécharger dans l'App Store diff --git a/pages/blog/[blog].js b/pages/blog/[blog].js index f7cf1ac..8d4f5ef 100644 --- a/pages/blog/[blog].js +++ b/pages/blog/[blog].js @@ -1,5 +1,5 @@ -import React from "react" -import Navigation from "../../components/Navigation" +import React, { useState } from "react" +import Navigation, { DownloadPopup } from "../../components/Navigation" import Footer from "../../components/Footer" import { serialize } from "next-mdx-remote/serialize" import { MDXRemote } from "next-mdx-remote" @@ -11,6 +11,7 @@ import { HiChevronLeft } from "react-icons/hi" import styles from "../../style/bloga.module.css" const Blog = ({ mdxSource, data }) => { + const [showPopup, setShowPopup] = useState(false) return ( <> @@ -20,7 +21,8 @@ const Blog = ({ mdxSource, data }) => { - + +
{ + const [showPopup, setShowPopup] = useState(false) return ( <> Blog | Oz Ensemble +
- +