diff --git a/public/assets/provisions_pop-up_background.svg b/public/assets/provisions_pop-up_background.svg deleted file mode 100644 index d290bf1ba8..0000000000 --- a/public/assets/provisions_pop-up_background.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/workspaces/website/src/blocks/HomepageHero.tsx b/workspaces/website/src/blocks/HomepageHero.tsx index 25c486f3fe..c41912a5ef 100644 --- a/workspaces/website/src/blocks/HomepageHero.tsx +++ b/workspaces/website/src/blocks/HomepageHero.tsx @@ -2,24 +2,19 @@ import { Box, Flex, Img, Stack } from "@chakra-ui/react"; import { Button } from "@ui/Button"; import { Heading } from "@ui/Typography/Heading"; import { Text } from "@ui/Typography/Text"; +import { Intro } from "./Intro"; +import ProvisionsPopup from "@ui/ProvisionsPopup/ProvisionsPopup"; type Props = { readonly seo: { heroText: string; }; }; -import { Intro } from "./Intro"; -import PopUp from "@ui/PopUp/PopUp"; -import { useState } from "react"; export const HomepageHero = ({ seo }: Props) => { - const [isOpen, setIsOpen] = useState(true); - const toggleModal = () => { - setIsOpen((prevState) => !prevState); - }; return ( <> - + { + return ( + + + + ); +}; + +export default ArrowRight; diff --git a/workspaces/website/src/components/ProvisionsPopup/CloseIcon/CloseIcon.tsx b/workspaces/website/src/components/ProvisionsPopup/CloseIcon/CloseIcon.tsx new file mode 100644 index 0000000000..63f4279afb --- /dev/null +++ b/workspaces/website/src/components/ProvisionsPopup/CloseIcon/CloseIcon.tsx @@ -0,0 +1,28 @@ +const CloseIcon = () => { + return ( + + + + + + + + + + + ); +}; + +export default CloseIcon; diff --git a/workspaces/website/src/components/PopUp/PopUp.tsx b/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx similarity index 60% rename from workspaces/website/src/components/PopUp/PopUp.tsx rename to workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx index fa276f6577..3ea65055a4 100644 --- a/workspaces/website/src/components/PopUp/PopUp.tsx +++ b/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx @@ -1,26 +1,19 @@ import { Box, Button, Image, Icon, Link, Fade } from "@chakra-ui/react"; import Background from "./PopUp-background.png"; import Logo from "./PopUp-Text.svg"; +import { useState } from "react"; +import CloseIcon from "./CloseIcon/CloseIcon"; +import ArrowRight from "./ArrowRight/ArrowRight"; -type Props = { - toggleModal: () => void; - isOpen: boolean; -}; +const ProvisionsPopup = () => { + const [isOpen, setIsOpen] = useState(true); -declare global { - interface Window { - dataLayer: { - event: string; - }[]; - } -} + const toggleModal = () => setIsOpen((prevState) => !prevState); -const PopUp = ({ toggleModal, isOpen }: Props) => { const gtmEvent = (event: string) => window?.dataLayer.push({ event }); - const gtmEventClickReadMore = () => gtmEvent("Provisions popup click"); - const gtmEventClickClose = () => gtmEvent("Provisions popup close"); + return ( { toggleModal(); }} > - - - - - - - - - - + { color: "#8FBCFF", }} > - - - + @@ -149,4 +108,4 @@ const PopUp = ({ toggleModal, isOpen }: Props) => { ); }; -export default PopUp; +export default ProvisionsPopup; diff --git a/workspaces/website/src/components/PopUp/PopUp-background.png b/workspaces/website/src/components/ProvisionsPopup/popup-background.png similarity index 100% rename from workspaces/website/src/components/PopUp/PopUp-background.png rename to workspaces/website/src/components/ProvisionsPopup/popup-background.png diff --git a/workspaces/website/src/components/PopUp/PopUp-Text.svg b/workspaces/website/src/components/ProvisionsPopup/popup-text.svg similarity index 100% rename from workspaces/website/src/components/PopUp/PopUp-Text.svg rename to workspaces/website/src/components/ProvisionsPopup/popup-text.svg diff --git a/workspaces/website/src/renderer/_default.page.server.tsx b/workspaces/website/src/renderer/_default.page.server.tsx index 34df2ba97f..8a16c7c072 100644 --- a/workspaces/website/src/renderer/_default.page.server.tsx +++ b/workspaces/website/src/renderer/_default.page.server.tsx @@ -17,6 +17,13 @@ export const passToClient = [ "data", "seo", ]; +declare global { + interface Window { + dataLayer: { + event: string; + }[]; + } +} export async function onBeforeRender(pageContext: PageContextServer) { return { @@ -41,29 +48,34 @@ export async function render(pageContext: PageContextServer) { }); const GOOGLE_TAG_ID = "G-WY42TERK5P"; - const pageSeo = (pageProps?.data ?? pageProps?.roadmapPost ?? pageProps?.tutorial) as SeoType + const pageSeo = (pageProps?.data ?? + pageProps?.roadmapPost ?? + pageProps?.tutorial) as SeoType; const documentProps = - pageContext.documentProps ?? pageContext.exports.documentProps + pageContext.documentProps ?? pageContext.exports.documentProps; // @ts-ignore - const isGeoRegulationsPage = pageProps?.data?.slug === 'provisions-geo-regulations'; + const isGeoRegulationsPage = + pageProps?.data?.slug === "provisions-geo-regulations"; - const title = isGeoRegulationsPage ? pageSeo?.seoTitle as string : ( - documentProps?.title ?? pageSeo?.seoTitle - ? `${documentProps?.title ?? pageSeo?.seoTitle} - Starknet` - : "Starknet" - ); + const title = isGeoRegulationsPage + ? (pageSeo?.seoTitle as string) + : documentProps?.title ?? pageSeo?.seoTitle + ? `${documentProps?.title ?? pageSeo?.seoTitle} - Starknet` + : "Starknet"; - const description = isGeoRegulationsPage ? pageSeo?.seoDescription as string : ( - documentProps?.description ?? pageSeo?.seoDescription as string ?? - "Starknet is the secure scaling technology bringing Ethereum’s benefits to the world." - ); + const description = isGeoRegulationsPage + ? (pageSeo?.seoDescription as string) + : documentProps?.description ?? + (pageSeo?.seoDescription as string) ?? + "Starknet is the secure scaling technology bringing Ethereum’s benefits to the world."; - const image = isGeoRegulationsPage ? `${import.meta.env.VITE_SITE_URL}/assets/provisions.png?v2` : - documentProps?.image ?? - `${import.meta.env.VITE_SITE_URL}/assets/share/generic_landing.png`; + const image = isGeoRegulationsPage + ? `${import.meta.env.VITE_SITE_URL}/assets/provisions.png?v2` + : documentProps?.image ?? + `${import.meta.env.VITE_SITE_URL}/assets/share/generic_landing.png`; - const focusKeywords = pageSeo?.seoFocusKeywords as string[] + const focusKeywords = pageSeo?.seoFocusKeywords as string[]; const documentHtml = escapeInject` @@ -75,7 +87,7 @@ export async function render(pageContext: PageContextServer) { ${title} - + @@ -102,9 +114,13 @@ export async function render(pageContext: PageContextServer) { @@ -128,9 +144,13 @@ export async function render(pageContext: PageContextServer) { })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); - ${pageSeo?.seoCanonicalUrl ? ` + ${ + pageSeo?.seoCanonicalUrl + ? ` - `: ''} + ` + : "" + }
${stream}