Skip to content

Commit 106b814

Browse files
committed
[Dashboard] Remove use-scroll-position
1 parent 0660416 commit 106b814

File tree

3 files changed

+21
-43
lines changed

3 files changed

+21
-43
lines changed

apps/dashboard/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@emotion/styled": "11.13.0",
3030
"@hookform/resolvers": "^3.9.0",
3131
"@marsidev/react-turnstile": "^1.0.2",
32-
"@n8tb1t/use-scroll-position": "^2.0.3",
3332
"@radix-ui/react-alert-dialog": "^1.1.2",
3433
"@radix-ui/react-avatar": "^1.1.1",
3534
"@radix-ui/react-checkbox": "^1.1.2",

apps/dashboard/src/components/product-pages/common/Topnav.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,20 @@
1-
import { Box, Container, Flex, useBreakpointValue } from "@chakra-ui/react";
2-
import { useScrollPosition } from "@n8tb1t/use-scroll-position";
1+
import { Box, Container, Flex } from "@chakra-ui/react";
32
import { Logo } from "components/logo";
4-
import { useState } from "react";
53
import { TrackedLink } from "tw-components";
64
import { DesktopMenu } from "./nav/DesktopMenu";
75
import { MobileMenu } from "./nav/MobileMenu";
86

97
export const HomepageTopNav: React.FC = () => {
10-
const isMobile = useBreakpointValue({ base: true, md: false });
11-
const [isScrolled, setIsScrolled] = useState(false);
12-
13-
useScrollPosition(
14-
({ currPos }) => {
15-
if (currPos.y < -5) {
16-
setIsScrolled(true);
17-
} else if (currPos.y >= -5) {
18-
setIsScrolled(false);
19-
}
20-
},
21-
[isMobile],
22-
undefined,
23-
false,
24-
16,
25-
);
26-
278
return (
289
<Box
29-
transition="all 50ms"
3010
position="sticky"
3111
top={0}
3212
left={0}
3313
w="100%"
34-
willChange="backdrop-filter background-color"
3514
zIndex="overlay"
3615
as="header"
37-
bgColor={isScrolled ? "rgba(0,0,0,0.8)" : "rgba(0,0,0,0)"}
38-
backdropFilter={
39-
isScrolled ? "saturate(180%) blur(20px)" : "saturate(100%) blur(0px)"
40-
}
16+
bgColor="rgba(0,0,0,0)"
17+
backdropFilter="saturate(100%) blur(0px)"
4118
>
4219
<Container
4320
as={Flex}

pnpm-lock.yaml

Lines changed: 18 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)