|
@@ -1,5 +1,7 @@
|
|
"use client";
|
|
"use client";
|
|
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
|
|
+import Router from 'next/router';
|
|
|
|
+import { useRouter } from "@/i18n";
|
|
import clsx from "clsx";
|
|
import clsx from "clsx";
|
|
import styles from "./style.module.scss";
|
|
import styles from "./style.module.scss";
|
|
|
|
|
|
@@ -22,14 +24,24 @@ const HeaderBack: FC<PropsWithChildren<HeaderBackProps>> = ({title = '', childre
|
|
const iconClassName2 = clsx({
|
|
const iconClassName2 = clsx({
|
|
[styles.iconfontIcon2]: true,
|
|
[styles.iconfontIcon2]: true,
|
|
},'iconfont icon-company_nav_icon_home');
|
|
},'iconfont icon-company_nav_icon_home');
|
|
|
|
+
|
|
|
|
+ const router:any = useRouter()
|
|
|
|
+ const goPage = (path = '') => {
|
|
|
|
+ if (path) {
|
|
|
|
+ router.replace('/')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ router.back()
|
|
|
|
+ }
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className={styles.headerBack}>
|
|
<div className={styles.headerBack}>
|
|
- <div className={styles.left}>
|
|
|
|
|
|
+ <div className={styles.left} onClick={() => goPage()}>
|
|
<span className={iconClassName1}></span>
|
|
<span className={iconClassName1}></span>
|
|
</div>
|
|
</div>
|
|
{title && <span className={styles.title}>{title}</span>}
|
|
{title && <span className={styles.title}>{title}</span>}
|
|
{children}
|
|
{children}
|
|
- <span className={styles.right}>
|
|
|
|
|
|
+ <span className={styles.right} onClick={() => goPage('home')}>
|
|
<span className={iconClassName2}></span>
|
|
<span className={iconClassName2}></span>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|