PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.8
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / src / blocks / post-grid-five / render.js

render.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.8, at src/blocks/post-grid-five/render.js

53 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { jsonParse, toggleEqualHeight } from "../shared/helpFn";
2 import { Fragment, useEffect, useRef } from "@wordpress/element";
3 import LoopContent from "./loopContent";
4 import { breakpoint } from "../../controls/controls";
5
6 const Render = ({ attributes, posts }) => {
7 const {
8 uniqueId,
9 postGridLayout,
10 equalHeightEnable,
11 // gridFiveMasonryEnable,
12 catTabCategoryPosition,
13 } = attributes;
14
15 const deviceType = breakpoint();
16 const gridRef = useRef(null);
17
18 useEffect(() => {
19 toggleEqualHeight(uniqueId, equalHeightEnable);
20 }, [equalHeightEnable, uniqueId, []]);
21
22 const HtmlTag = "div";
23
24 return (
25 <div
26 className={`sp-smart-show-pro grid-five-container sp-cat-position-${catTabCategoryPosition}`}
27 ref={gridRef}
28 >
29 {"Mobile" !== deviceType && (
30 <div
31 className={`sp-smart-post-grid-five-dynamic-contents sp-smart-post-background-layout ${postGridLayout}`}
32 >
33 <LoopContent posts={posts} attributes={attributes} gridRef={gridRef} />
34 </div>
35 )}
36 <HtmlTag
37 className={`sp-smart-post-grid-five-static-contents sp-smart-post-background-layout ${postGridLayout}`}
38 >
39 <LoopContent
40 bottomStyle={true}
41 Masonry={false}
42 ResponsiveMasonry={Fragment}
43 posts={posts}
44 attributes={attributes}
45 gridRef={gridRef}
46 />
47 </HtmlTag>
48 </div>
49 );
50 };
51
52 export default Render;
53