PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.7
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.7
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-two / render.js

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

39 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { toggleEqualHeight } from "../shared/helpFn";
2 import { Fragment, useEffect, useRef } from "@wordpress/element";
3 import LoopContent from "./loopContent";
4
5 const Render = ({ attributes, posts }) => {
6 const { uniqueId, equalHeightEnable, catTabCategoryPosition, contentOnHover } = attributes;
7
8 const containerRef = useRef(null);
9
10 useEffect(() => {
11 toggleEqualHeight(uniqueId, equalHeightEnable);
12 }, [equalHeightEnable, uniqueId, []]);
13
14 // const HtmlTag = gridTwoMasonryEnable ? Fragment : 'div';
15 const HtmlTag = "div";
16
17 return (
18 <div
19 className={`sp-smart-show-pro sp-smart-post-block-wrapper grid-two-container sp-cat-position-${catTabCategoryPosition} sp-smart-post-background-layout ${contentOnHover ? "sp-content-on-hover" : ""}`}
20 ref={containerRef}
21 >
22 <div className={`sp-smart-post-grid-two-contents sp-smart-post-grid-two`}>
23 <HtmlTag className={`sp-smart-post-dynamic-grid-contents`}>
24 <LoopContent
25 bottomStyle={true}
26 Masonry={false}
27 ResponsiveMasonry={Fragment}
28 posts={posts}
29 attributes={attributes}
30 containerRef={containerRef}
31 />
32 </HtmlTag>
33 </div>
34 </div>
35 );
36 };
37
38 export default Render;
39