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

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