diff --git a/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/classes.module.scss b/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/classes.module.scss index d0b41f6c..e99cca13 100644 --- a/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/classes.module.scss +++ b/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/classes.module.scss @@ -1,41 +1,45 @@ @import "@Themes/constants.scss"; .root { + position: relative; .content { display: flex; .sides { min-height: calc(100vh - 83px); - height: fit-content; width: 50%; @media (max-width: $screen-m) { width: 100%; } + } + } - &.image-container { - @media (max-width: $screen-m) { - display: none; - } + .image-container { + @media (max-width: $screen-m) { + display: none; + } - background: var(--color-neutral-50); + background: var(--color-neutral-50); - .image { - width: 100%; - object-fit: contain; - } - } + .image { + width: 100%; + object-fit: contain; + } + } - &.background-image-container { - height: 0px; - @media (max-width: $screen-m) { - display: none; - } + .background-image-container { + position: fixed; + width: 50vw; + top: 83px; + right: 0; + height: calc(100vh - 83px); + @media (max-width: $screen-m) { + display: none; + } - .background-image { - width: 100%; - height: 100%; - object-fit: cover; - } - } + .background-image { + width: 100%; + height: 100%; + object-fit: cover; } } } diff --git a/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx b/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx index fa0b44cf..279227ce 100644 --- a/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx @@ -2,7 +2,7 @@ import Header from "@Front/Components/DesignSystem/Header"; import Version from "@Front/Components/DesignSystem/Version"; import classNames from "classnames"; import Image, { StaticImageData } from "next/image"; -import React, { ReactNode, useEffect, useRef } from "react"; +import React, { ReactNode, useEffect } from "react"; import classes from "./classes.module.scss"; @@ -28,48 +28,23 @@ export default function DefaultDoubleSidePage(props: IProps) { } }, [scrollTop, title]); - useEffect(() => { - // make second element ref height same as first element ref height - const resizeObserver = new ResizeObserver(() => { - if (secondElementRef.current && firstElementRef.current) { - console.log("Recalculate"); - if (secondElementRef.current.clientHeight !== 0) { - secondElementRef.current.style.height = `0px`; - } - - secondElementRef.current.style.height = `${firstElementRef.current.clientHeight}px`; - } - }); - - if (firstElementRef.current) { - resizeObserver.observe(firstElementRef.current); - } - - return () => resizeObserver.disconnect(); - }, []); - - const firstElementRef = useRef(null); - const secondElementRef = useRef(null); - return (
-
- {children} -
- {type === "image" && ( -
- {"right -
- )} - {type === "background" && ( -
- {"right -
- )} +
{children}
+ {type === "image" && ( +
+ {"right +
+ )} + {type === "background" && ( +
+ {"right +
+ )}
); }