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