Skip to content

Commit

Permalink
nav z-index fix
Browse files Browse the repository at this point in the history
  • Loading branch information
heyjul3s committed Jan 14, 2021
1 parent 2c6f965 commit 6747078
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docs/components/Global/NavTop/NavTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import React from 'react';
import { AnchorLink } from '../../AnchorLink';
import { ArtifakTypeLogo } from '../../../assets/ArtifakTypeLogo';
import { NavTopContainer, NavTopMenu, NavTopLink } from './styles';
import { MobileNavContext } from '../../Nav/Mobile/context';

export function NavTop() {
const mobileNavContext = React.useContext(MobileNavContext);
const panelOpen = !!mobileNavContext ? mobileNavContext.panelOpen : false;

return (
<NavTopContainer>
<NavTopContainer panelOpen={panelOpen}>
<AnchorLink
href="/"
style={{
Expand Down
4 changes: 2 additions & 2 deletions docs/components/Global/NavTop/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export const NavTopLink = styled(AnchorLink)`
top: 2px;
`;

export const NavTopContainer = styled.div`
export const NavTopContainer = styled.div<{ panelOpen: boolean }>`
position: relative;
width: 100%;
height: 60px;
display: flex;
justify-content: space-between;
z-index: 2;
z-index: 1;
${({ theme }) => `
background-color: ${theme.colors.primary};
Expand Down
2 changes: 1 addition & 1 deletion docs/components/Nav/Mobile/MobileNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function MobileNav() {
setViewIndex
}}
>
<NavContainer panelOpen={panelOpen}>
<NavContainer>
<NavSlides />
<Navbar />
</NavContainer>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/Nav/Mobile/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

export const NavContainer = styled.div<{ panelOpen: boolean }>`
export const NavContainer = styled.div`
position: fixed;
top: 0;
left: 0;
Expand Down

0 comments on commit 6747078

Please sign in to comment.