хедер главной без выбора тарифа

This commit is contained in:
Nastya 2023-07-27 21:22:45 +03:00
parent 912d16c22d
commit e1dd6d95b7
3 changed files with 22 additions and 5 deletions

@ -14,6 +14,7 @@ export default function Menu() {
const location = useLocation();
const color = location.pathname === "/" ? "white" : "black";
console.log(location)
const arrayMenu: MenuItem[] = [
{
@ -39,7 +40,7 @@ export default function Menu() {
overflow: "hidden",
}}
>
{arrayMenu.map(({ name, url, subMenu = [] }) => (
{location.pathname !== "/" ? arrayMenu.map(({ name, url, subMenu = [] }) => (
<Link
key={name}
style={{
@ -65,7 +66,23 @@ export default function Menu() {
{name}
</Typography>
</Link>
))}
))
:arrayMenu.map(({ name, url, subMenu = [] }) => (
<Typography
color={
location.pathname === url
? theme.palette.brightPurple.main
: color
}
variant="body2"
sx={{
whiteSpace: "nowrap",
}}
>
{name}
</Typography>
))
}
<Box
sx={{
zIndex: "10",
@ -77,7 +94,7 @@ export default function Menu() {
}}
onMouseLeave={() => setActiveSubMenu([])}
>
{activeSubMenu.map(({ name, url }) => (
{location.pathname !== "/" && activeSubMenu.map(({ name, url }) => (
<Link key={name} style={{ textDecoration: "none" }} to={url}>
<Typography
color={

@ -84,7 +84,7 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
sx={{
zIndex: 1501,
width: isMobile ? "100%" : "320px",
ml: "auto",
mr: "auto",
height: "100%",
"& .MuiPaper-root.MuiDialog-paper": {
background: theme.palette.background.default,

@ -27,8 +27,8 @@ interface Props {
export default function NavbarFull({ isLoggedIn }: Props) {
const theme = useTheme();
const location = useLocation();
const navigate = useNavigate();
const location = useLocation();
const user = useUserStore((state) => state.user);
const cash = useUserStore((state) => state.userAccount?.wallet.cash) ?? 0;