Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix: overlay on menu open.
Browse files Browse the repository at this point in the history
  • Loading branch information
AtuyL committed Nov 30, 2018
1 parent 3a2f1c4 commit 96cf727
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions app/components/header.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import React from 'react'
import React, { Fragment } from 'react'
import styled from 'styled-components'
import { transparentize } from 'polished'
import { neutral } from 'dat-colors'
Expand All @@ -9,29 +9,38 @@ import * as Button from './button'
import Icon from './icon'

const Container = styled.header`
position: fixed;
z-index: 1;
width: 100%;
height: 2.5rem;
padding: 0.25rem 0.75rem;
display: flex;
align-items: center;
justify-content: flex-end;
-webkit-app-region: drag;
background-color: var(--color-neutral);
color: var(--color-white);
& ~ main {
margin-top: 2.5rem;
}
`

const HideLayer = styled.div`
position: absolute;
background: ${transparentize(0.85, neutral)};
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
z-index: 2;
`

const Header = ({ onShare, onMenu, onReport, menuVisible, version }) => {
const toggleMenu = () => onMenu(!menuVisible)
return (
<Container>
<Fragment>
{menuVisible && <HideLayer onClick={toggleMenu} />}
<div className='fr relative'>
<Container>
<DatImport />
<Button.Header
icon={<Icon name='create-new-dat' style={{ width: '1.2em' }} />}
Expand Down Expand Up @@ -66,8 +75,8 @@ const Header = ({ onShare, onMenu, onReport, menuVisible, version }) => {
</p>
</div>
)}
</div>
</Container>
</Container>
</Fragment>
)
}

Expand Down

0 comments on commit 96cf727

Please sign in to comment.