UNPKG

@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.

2 lines (1 loc) 704 B
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),n=require("semantic-ui-react"),l=()=>{const[r,t]=s.useState(!1);s.useEffect(()=>{const o=()=>{window.pageYOffset>150?t(!0):t(!1)};return window.addEventListener("scroll",o),()=>{window.removeEventListener("scroll",o)}},[window.scroll]);const i=()=>{document.body.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})};return e.jsx(e.Fragment,{children:r&&e.jsx("div",{id:"top-navigator",className:"top-navigator",children:e.jsx(n.Menu,{children:e.jsx(n.Menu.Item,{onClick:i,children:"Back to the top"})})})})};exports.default=l;