| 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 |
|