-
Notifications
You must be signed in to change notification settings - Fork 619
[Dashboard] Remove use-scroll-position #5274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,20 @@ | ||
| import { Box, Container, Flex, useBreakpointValue } from "@chakra-ui/react"; | ||
| import { useScrollPosition } from "@n8tb1t/use-scroll-position"; | ||
| import { Box, Container, Flex } from "@chakra-ui/react"; | ||
| import { Logo } from "components/logo"; | ||
| import { useState } from "react"; | ||
| import { TrackedLink } from "tw-components"; | ||
| import { DesktopMenu } from "./nav/DesktopMenu"; | ||
| import { MobileMenu } from "./nav/MobileMenu"; | ||
|
|
||
| export const HomepageTopNav: React.FC = () => { | ||
| const isMobile = useBreakpointValue({ base: true, md: false }); | ||
| const [isScrolled, setIsScrolled] = useState(false); | ||
|
|
||
| useScrollPosition( | ||
| ({ currPos }) => { | ||
| if (currPos.y < -5) { | ||
| setIsScrolled(true); | ||
| } else if (currPos.y >= -5) { | ||
| setIsScrolled(false); | ||
| } | ||
| }, | ||
| [isMobile], | ||
| undefined, | ||
| false, | ||
| 16, | ||
| ); | ||
|
|
||
| return ( | ||
| <Box | ||
| transition="all 50ms" | ||
| position="sticky" | ||
| top={0} | ||
| left={0} | ||
| w="100%" | ||
| willChange="backdrop-filter background-color" | ||
| zIndex="overlay" | ||
| as="header" | ||
| bgColor={isScrolled ? "rgba(0,0,0,0.8)" : "rgba(0,0,0,0)"} | ||
| backdropFilter={ | ||
| isScrolled ? "saturate(180%) blur(20px)" : "saturate(100%) blur(0px)" | ||
| } | ||
| bgColor="rgba(0,0,0,0)" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MananTank I gave it a default blur-20px. This page is very soon to be deleted by so it's up to you. I'm fine with closing this PR (it was a weekend idea anyway)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah let's not do this - also let's not waste time on pages that will be deleted or moved to framer soon, we have lots to do on "in app" pages :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood ^ |
||
| backdropFilter="saturate(100%) blur(20px)" | ||
| > | ||
| <Container | ||
| as={Flex} | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.


Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This navbar is only used in the few pages that (pretty sure) will be converted to Framer.
What it does is change the background color effects on scrolling down. We can achieve the same thing with useEffect(?) however I think it's not that big of a deal so we can just make it "static". (Less JS in overall)