mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Remove "scroll to top" button, it's causing page renders on every scroll
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
0c55b25919
commit
b0c6aa48a4
|
@ -6,7 +6,6 @@ import classes from "./App.module.css";
|
|||
import PrometheusLogo from "./images/prometheus-logo.svg";
|
||||
|
||||
import {
|
||||
Affix,
|
||||
AppShell,
|
||||
Box,
|
||||
Burger,
|
||||
|
@ -16,13 +15,11 @@ import {
|
|||
Menu,
|
||||
Skeleton,
|
||||
Text,
|
||||
Transition,
|
||||
createTheme,
|
||||
rem,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useWindowScroll } from "@mantine/hooks";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import {
|
||||
IconArrowUp,
|
||||
IconBellFilled,
|
||||
IconChevronDown,
|
||||
IconChevronRight,
|
||||
|
@ -180,7 +177,6 @@ const getPathPrefix = (path: string) => {
|
|||
const navLinkXPadding = "md";
|
||||
|
||||
function App() {
|
||||
const [scroll, scrollTo] = useWindowScroll();
|
||||
const [opened, { toggle }] = useDisclosure();
|
||||
|
||||
const pathPrefix = getPathPrefix(window.location.pathname);
|
||||
|
@ -422,23 +418,6 @@ function App() {
|
|||
</Routes>
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Affix position={{ bottom: 20, right: 20 }}>
|
||||
<Transition transition="slide-up" mounted={scroll.y > 0}>
|
||||
{(transitionStyles) => (
|
||||
<Button
|
||||
leftSection={
|
||||
<IconArrowUp
|
||||
style={{ width: rem(16), height: rem(16) }}
|
||||
/>
|
||||
}
|
||||
style={transitionStyles}
|
||||
onClick={() => scrollTo({ y: 0 })}
|
||||
>
|
||||
Scroll to top
|
||||
</Button>
|
||||
)}
|
||||
</Transition>
|
||||
</Affix>
|
||||
</AppShell.Main>
|
||||
</AppShell>
|
||||
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
||||
|
|
Loading…
Reference in a new issue