1
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
.customerNavbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
// 背景颜色通过 style 动态设置,默认 #FAFAFA
|
||||
box-shadow: none;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import { View } from "@tarojs/components";
|
||||
import styles from "./index.module.scss";
|
||||
import { useGlobalState } from "@/store/global";
|
||||
|
||||
interface IProps {
|
||||
children: any;
|
||||
backgroundColor?: string; // 背景颜色,不设置则透明
|
||||
}
|
||||
|
||||
const CustomNavbar = (props: IProps) => {
|
||||
const { children, backgroundColor } = props;
|
||||
const { statusNavbarHeightInfo } = useGlobalState();
|
||||
const { statusBarHeight, navBarHeight } = statusNavbarHeightInfo;
|
||||
|
||||
return (
|
||||
<View
|
||||
className={styles.customerNavbar}
|
||||
style={{
|
||||
height: `${statusBarHeight + navBarHeight}px`,
|
||||
backgroundColor: backgroundColor || 'transparent'
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
export default CustomNavbar;
|
||||
Reference in New Issue
Block a user