@devgateway/dvz-ui-react
Version:
A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.
22 lines (21 loc) • 818 B
JavaScript
import { jsx as o, Fragment as l } from "react/jsx-runtime";
import i, { useEffect as a } from "react";
import { Menu as r } from "semantic-ui-react";
const f = () => {
const [n, e] = i.useState(!1);
a(() => {
const t = () => {
window.pageYOffset > 150 ? e(!0) : e(!1);
};
return window.addEventListener("scroll", t), () => {
window.removeEventListener("scroll", t);
};
}, [window.scroll]);
const s = () => {
document.body.scrollIntoView({ behavior: "smooth", block: "start", inline: "start" });
};
return /* @__PURE__ */ o(l, { children: n && /* @__PURE__ */ o("div", { id: "top-navigator", className: "top-navigator", children: /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(r.Item, { onClick: s, children: "Back to the top" }) }) }) });
};
export {
f as default
};