Skip to content

Commit

Permalink
Merge pull request #493 from tianenpang/fix/docs-navbar-transparent
Browse files Browse the repository at this point in the history
fix(docs): navbar background transparent after refresh
  • Loading branch information
jrgarciadev committed May 26, 2022
2 parents 3aa92a9 + beb3fa6 commit 02e77b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/docs/src/layouts/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ const Navbar: React.FC<Props> = ({ isHome, hasNotify, routes }) => {
const router = useRouter();
const isMobile = useMediaQuery(960);
const [, setBodyHidden] = useBodyScroll(null, { scrollLayer: true });
const [scrollPosition, setScrollPosition] = useState(
(typeof window !== 'undefined' && window.pageYOffset) || 0
);
const [scrollPosition, setScrollPosition] = useState(0);

const detached = hasNotify ? scrollPosition > 30 : scrollPosition > 0;

useEffect(() => {
setScrollPosition(
(typeof window !== 'undefined' && window.pageYOffset) || 0
);
window.addEventListener('scroll', onScroll.bind(this));
return () => {
window.removeEventListener('scroll', onScroll.bind(this));
Expand Down

1 comment on commit 02e77b3

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for nextui-docs ready!

✅ Preview
https://nextui-docs-gaz40byxk-nextui-org.vercel.app

Built with commit 02e77b3.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.