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-three / 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-three/render.js

62 lines 1.7 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 import { breakpoint } from "../../controls/controls";
5
6 const Render = ({ attributes, posts }) => {
7 const {
8 uniqueId,
9 postGridLayout,
10 equalHeightEnable,
11 catTabCategoryPosition,
12 // gridThreeMasonryEnable,
13 } = attributes;
14
15 const deviceType = breakpoint();
16 const containerRef = useRef(null);
17
18 useEffect(() => {
19 toggleEqualHeight(uniqueId, equalHeightEnable);
20 }, [equalHeightEnable, uniqueId, []]);
21
22 // const HtmlTag = gridThreeMasonryEnable ? Fragment : 'div';
23 const HtmlTag = "div";
24
25 return (
26 <div
27 className={`sp-smart-show-pro grid-three-container sp-cat-position-${catTabCategoryPosition}`}
28 ref={containerRef}
29 >
30 <div className={`sp-smart-post-grid-three-contents ${postGridLayout}`}>
31 {"Mobile" !== deviceType && (
32 <div
33 className={`sp-smart-post-static-grid-contents sp-smart-post-background-layout ${postGridLayout}`}
34 >
35 <LoopContent posts={posts} attributes={attributes} containerRef={containerRef} />
36 </div>
37 )}
38 <HtmlTag
39 className={`sp-smart-post-dynamic-grid-contents sp-smart-post-background-layout ${postGridLayout}`}
40 >
41 <LoopContent
42 bottomStyle={true}
43 // Masonry={ gridThreeMasonryEnable ? Masonry : false }
44 // ResponsiveMasonry={
45 // gridThreeMasonryEnable
46 // ? ResponsiveMasonry
47 // : Fragment
48 // }
49 Masonry={false}
50 ResponsiveMasonry={Fragment}
51 posts={posts}
52 attributes={attributes}
53 containerRef={containerRef}
54 />
55 </HtmlTag>
56 </div>
57 </div>
58 );
59 };
60
61 export default Render;
62