Skip to content

Commit

Permalink
Bug Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Colangelo committed Sep 3, 2020
1 parent 94e3313 commit a65c6c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@piero80/react-fullscreen-menu",
"name": "react-fullscreen-menu",
"version": "1.0.2",
"description": "Simple Fullscreen Menu in React with Css Transition and Styled Component",
"author": "Pietro Colangelo",
Expand Down
4 changes: 4 additions & 0 deletions src/Menu.styled.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import styled from 'styled-components'

export const StyledContainer = styled.div`
position: fixed;
`

export const StyledMenu = styled.section`
position: fixed;
top: 0;
Expand Down
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React, { useState, Fragment } from 'react'
import { StyledIcon } from './Icon.styled'
import { StyledMenu } from './Menu.styled'
import { StyledMenu, StyledContainer } from './Menu.styled'

import { ReactComponent as CloseIcon } from './images/close.svg'
import { ReactComponent as MenuIcon } from './images/menu.svg'
import { ReactComponent as BackIcon } from './images/back.svg'

export const FullscreenMenu = ({ data, position }) => {
const [open, setOpen] = useState(false)
return (
<div className='menu-burger-container'>
<StyledContainer>
<MenuBurger open={open} setOpen={setOpen} position={position}>
<Menu open={open} data={data} setOpen={setOpen}></Menu>
</MenuBurger>
</div>
</StyledContainer>
)
}

Expand All @@ -37,6 +38,7 @@ function Menu({ open, setOpen, data }) {
const [selectedItemMenu, toggleMenu] = useState(-1)

function openSubMenu(index) {
console.log('CLICK')
toggleMenu(selectedItemMenu === index ? -1 : index)
setSub(!sub)
}
Expand Down

0 comments on commit a65c6c5

Please sign in to comment.