Remove the overlap

Asked

Viewed 25 times

0

I am using the React-Burguer-menu and it is over all the content. I would like to get all the content to the side when opening the menu. inserir a descrição da imagem aqui

Follow code in the Burger

import React from "react";
import { slide as Menu } from "react-burger-menu";

import { BurguerMenu } from "./styles.js";

import { store } from "../../../store";

const BurguerNavBar = (props) => {
  const { administrator } = store.getState().user.profile;

  return (
    <BurguerMenu>
      <Menu {...props} isOpen={true} noOverlay noTransition width={"20vw"}>
        <a className="menu-item" href="/">
          Home
        </a>
        {administrator === "T" && (
          <a className="menu-item" href="/Register">
            Register
          </a>
        )}
      </Menu>
    </BurguerMenu>
  );
};
export default BurguerNavBar;

Style Burger

export const BurguerMenu = styled.div`
  /* Position and sizing of burger button */
  .bm-burger-button {
    position: fixed;
    width: 20px;
    height: 15px;
    left: 25px;
    top: 20px;
  }

  /* Color/shape of burger icon bars */
  .bm-burger-bars {
    background: #373a47;
  }

  /* Color/shape of burger icon bars on hover*/
  .bm-burger-bars-hover {
    background: #a90000;
  }

  /* Position and sizing of clickable cross button */
  .bm-cross-button {
    height: 24px;
    width: 24px;
  }

  /* Color/shape of close button cross */
  .bm-cross {
    background: #bdc3c7;
  }

  /*
  Sidebar wrapper styles
  Note: Beware of modifying this element as it can break the animations - you should not need to touch it in most cases
  */
  .bm-menu-wrap {
    position: fixed;
    height: 100%;
  }

  /* General sidebar styles */
  .bm-menu {
    background: #1f0741;
    padding: 2.5em 1.5em 0;
    font-size: 1.15em;
  }

  /* Morph shape necessary with bubble or elastic */
  .bm-morph-shape {
    fill: #373a47;
  }

  /* Wrapper for item list */
  .bm-item-list {
    color: #b8b7ad;
    padding: 0.8em;
  }

  /* Individual item */
  .bm-item {
    display: inline-block;
  }

  /* Styling of overlay */
  .bm-overlay {
    background: rgba(0, 0, 0, 0.3);
  }
  .bm-item {
    display: inline-block;

    color: #d1d1d1;
    margin-bottom: 10px;
    text-align: left;
    text-decoration: none;
    transition: color 0.2s;
  }

  .bm-item:hover {
    color: #ffffff;
  }
`;

Navbar code

import React from "react";
import { useSelector } from "react-redux";
import logo from "../../assets/Logo3.png";
import LongMenu from "./dropdown";

import Burguer from "./burguer/burguer";

import { Container, Content, Profile } from "./styles";

export default function Header() {
  const profile = useSelector((state) => state.user.profile);
  return (
    <div>
      <Container>
        <Content>
          <nav>
            <Burguer />
            <img src={logo} alt="Delivery Smart" height={50} />
          </nav>

          <aside>
            <Profile>
              <div>
                <strong>{profile.name}</strong>
                <div>
                  <LongMenu />
                </div>
              </div>
            </Profile>
          </aside>
        </Content>
      </Container>
    </div>
  );
}

Style Navbar

export const Container = styled.div`
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.08) 0px 4px 12px;
`;

export const Content = styled.div`
  display: flex;
  justify-content: space-between;
  align-items: center;
  img {
    padding-left: 40px;
  }
  nav {
  }
`;
export const Profile = styled.div`
  strong {
    margin-right: 10px;
  }
  div {
    display: flex;
    align-items: center;
  }
  h1 {
    color: #1f0741;
  }
`;
  • Difficult to help without having more information... You can enter the output of your code so we can reproduce your problem?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.