|
@@ -1,103 +1,7 @@
|
|
|
-// "use client";
|
|
|
-// import Footer, { FooterProps } from "@/components/Footer";
|
|
|
-// import Header, { HeaderProps } from "@/components/Header";
|
|
|
-// import { FC, PropsWithChildren, useEffect, useRef, useState } from "react";
|
|
|
-// import { SwiperClass } from "swiper/react";
|
|
|
-// import Sidebar from "./Sidebar";
|
|
|
-// import styles from "./style.module.scss";
|
|
|
-// type Props = FooterProps & HeaderProps;
|
|
|
-// const Layout: FC<PropsWithChildren<Props>> = (props) => {
|
|
|
-// console.count("layout render");
|
|
|
-// const { children, ...other } = props;
|
|
|
-//
|
|
|
-// const swiperRef = useRef<SwiperClass>();
|
|
|
-// const isOpen = useRef<boolean>(false);
|
|
|
-// const homeContainerRef = useRef<HTMLDivElement>(null);
|
|
|
-// const barRef = useRef<HTMLDivElement>(null);
|
|
|
-// const leftRef = useRef<HTMLDivElement>(null);
|
|
|
-//
|
|
|
-// const [mounted, setMounted] = useState(false);
|
|
|
-//
|
|
|
-// useEffect(() => {
|
|
|
-// setMounted(true);
|
|
|
-// }, []);
|
|
|
-//
|
|
|
-// const startHandler = () => {
|
|
|
-// homeContainerRef.current?.classList.add(styles.containerMask);
|
|
|
-// barRef.current?.classList.add(styles.cross);
|
|
|
-// isOpen.current = true;
|
|
|
-// };
|
|
|
-// const endHandler = () => {
|
|
|
-// homeContainerRef.current?.classList.remove(styles.containerMask);
|
|
|
-// barRef.current?.classList.remove(styles.cross);
|
|
|
-// isOpen.current = false;
|
|
|
-// };
|
|
|
-//
|
|
|
-// const openSliderHandler = () => {
|
|
|
-// // if (isOpen.current) {
|
|
|
-// // swiperRef.current?.slideNext();
|
|
|
-// // } else {
|
|
|
-// // swiperRef.current?.slidePrev();
|
|
|
-// // }
|
|
|
-// const isOpen = leftRef.current!.style.width === "0px";
|
|
|
-// leftRef.current!.style.transition = "width 0.3s ease-in";
|
|
|
-// if (isOpen) {
|
|
|
-// leftRef.current!.style.width = "70%";
|
|
|
-// setTimeout(() => {
|
|
|
-// leftRef.current!.style.opacity = "1";
|
|
|
-// }, 300);
|
|
|
-// } else {
|
|
|
-// leftRef.current!.style.opacity = "0";
|
|
|
-// leftRef.current!.style.width = "0px";
|
|
|
-// }
|
|
|
-// };
|
|
|
-//
|
|
|
-// return (
|
|
|
-// <>
|
|
|
-// <div className={"flex"}>
|
|
|
-// <section
|
|
|
-// style={{ width: "0px", opacity: 0 }}
|
|
|
-// className={"flex-shrink-0"}
|
|
|
-// ref={leftRef}
|
|
|
-// >
|
|
|
-// <Sidebar></Sidebar>
|
|
|
-// </section>
|
|
|
-// <section className={"w-[100%]"}>
|
|
|
-// <Header
|
|
|
-// {...other}
|
|
|
-// menuRender={() => (
|
|
|
-// <div ref={homeContainerRef}>
|
|
|
-// <div
|
|
|
-// className={`absolute left-[0.1rem] top-[0.03rem] z-40 text-[#fff]`}
|
|
|
-// ref={barRef}
|
|
|
-// onClick={openSliderHandler}
|
|
|
-// >
|
|
|
-// <div className={styles.bar}></div>
|
|
|
-// <div
|
|
|
-// className={styles.bar}
|
|
|
-// style={{ width: "0.1389rem" }}
|
|
|
-// ></div>
|
|
|
-// <div className={styles.bar}></div>
|
|
|
-// </div>
|
|
|
-// </div>
|
|
|
-// )}
|
|
|
-// ></Header>
|
|
|
-// <main className={styles.main} id="maincontainer">
|
|
|
-// {children}
|
|
|
-// </main>
|
|
|
-// <Footer></Footer>
|
|
|
-// </section>
|
|
|
-// </div>
|
|
|
-// </>
|
|
|
-// );
|
|
|
-// };
|
|
|
-//
|
|
|
-// export default Layout;
|
|
|
-
|
|
|
"use client";
|
|
|
import { FooterProps } from "@/components/Footer";
|
|
|
import { HeaderProps } from "@/components/Header";
|
|
|
-import { FC, PropsWithChildren, useEffect, useRef, useState } from "react";
|
|
|
+import { FC, PropsWithChildren, useRef } from "react";
|
|
|
import { Swiper, SwiperClass, SwiperSlide } from "swiper/react";
|
|
|
import styles from "./style.module.scss";
|
|
|
type Props = FooterProps & HeaderProps;
|
|
@@ -110,12 +14,6 @@ const Layout: FC<PropsWithChildren<Props>> = (props) => {
|
|
|
const homeContainerRef = useRef<HTMLDivElement>(null);
|
|
|
const barRef = useRef<HTMLDivElement>(null);
|
|
|
|
|
|
- const [mounted, setMounted] = useState(false);
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- setMounted(true);
|
|
|
- }, []);
|
|
|
-
|
|
|
const startHandler = () => {
|
|
|
homeContainerRef.current?.classList.add(styles.containerMask);
|
|
|
barRef.current?.classList.add(styles.cross);
|