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) 1.16 kB
"use strict";const t=require("react/jsx-runtime"),i=require("react"),g=require("semantic-ui-react"),o=require("@devgateway/wp-react-lib"),l=require("@react-spring/parallax"),j=require("../connected-templates/PostContent.js"),P=require("../utils/parseUtils.js"),q=({posts:a,configuration:r})=>{const n=e=>e.sticky?{sticky:{start:e.sticky?e.stickyStart:e.offset,end:e.sticky?e.stickyEnd:e.offset}}:{offset:e.offset,speed:e.speed};return t.jsx(i.Fragment,{children:a&&a.map((e,s)=>t.jsx(i.Fragment,{children:r&&r[s]&&t.jsx(l.ParallaxLayer,{...n(r[s]),children:t.jsx(j,{as:g.Container,fluid:!0,post:e})},"parallax_"+s)}))})},R=a=>{const[r,n]=i.useState(Math.random()*99998+1),{"data-height":e,"data-type":s,"data-taxonomy":c,"data-categories":d,"data-scrolls":u,"data-configuration":p,parent:x,unique:h}=a,m=P.parse(p),y=i.useRef(null);return t.jsx("div",{style:{width:"100%",height:e+"px"},className:"parallax-container",children:t.jsx(l.Parallax,{ref:y,pages:u,children:t.jsx(o.PostProvider,{type:s,taxonomy:c,categories:d,store:"parallax"+x+"_"+h,page:1,perPage:50,children:t.jsx(o.PostConsumer,{children:t.jsx(q,{configuration:m})})})})})};module.exports=R;