Start adding NavBar #25

This commit is contained in:
prayag17 committed 2023-04-01 14:18:47 +05:30
1 parent f12d92f42c
commit d6c7c29b46
10 files changed
+150 -5

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
/** @format */
import MuiAppBar from "@mui/material/AppBar";
import TextField from "@mui/material/TextField";
import IconButton from "@mui/material/IconButton";
import InputAdornment from "@mui/material/InputAdornment";
import Toolbar from "@mui/material/Toolbar";
import { MdiMagnify } from "../icons/mdiMagnify";
import { theme } from "../../theme";
import { useSelector } from "react-redux";
import "./appBar.module.scss";
export const AppBar = () => {
const visible = useSelector((state) => state.appBar.visible);
const backdropVisible = useSelector((state) => state.appBar.backdrop);
// console.log(backdropVisible);
// const trigger = useScrollTrigger({
// disableHysteresis: true,
// threshold: 0,
// // target: document.querySelector(".scrollY"),
// });
// console.log(trigger);
return (
visible && (
<MuiAppBar
sx={{
width: `calc(100vw - ${theme.spacing(7)} - 10px)`,
background: backdropVisible
? theme.palette.background.paper
: "transparent",
}}
className="appBar"
elevation={backdropVisible ? 6 : 0}
>
<Toolbar>
<TextField
variant="outlined"
label="search"
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton size="small">
<MdiMagnify />
</IconButton>
</InputAdornment>
),
}}
size="small"
/>
</Toolbar>
</MuiAppBar>
)
);
};