Skip to content

Commit

Permalink
fixed mobile navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-Web3 committed May 19, 2023
1 parent c28215d commit e07c670
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/components/shared/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ const Header: React.FC<{
'header__dropdown',
'header__ellipsis',
'dropdown__option',
'header__chevron',
]
const listener = function (e: MouseEvent) {
if (!classNames.includes((e.target as HTMLElement).className)) {
setIsDropDownOpen(false)
setIsNavOpened(false)
}
}
document.body.addEventListener('click', listener)
Expand All @@ -45,11 +47,7 @@ const Header: React.FC<{
}, [])

return (
<motion.header
layout
// transition={{ type: 'spring', stiffness: 500, damping: 30 }}
className="header"
>
<motion.header layout className="header">
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
Expand Down
2 changes: 1 addition & 1 deletion src/sass/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ body {
z-index: -1;
}
@media (max-width: 700px) {
position: sticky;
position: absolute;
inset: 0 0 auto 0;
height: max-content;
}
Expand Down
3 changes: 3 additions & 0 deletions src/sass/shared/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
border-radius: 8px;
margin: $spacer auto 0;

@include screen(700, 'max') {
box-shadow: 0 0 3px rgba($dark-400, 0.35);
}
@include screen(700) {
margin: 0;
display: flex;
Expand Down

0 comments on commit e07c670

Please sign in to comment.