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 / components / focalPoint / focalPointPicker.js

focalPointPicker.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.7, at src/components/focalPoint/focalPointPicker.js

35 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { memo } from "@wordpress/element";
2 import { FocalPointPicker } from "@wordpress/components";
3 import "./editor.scss";
4 import { priceLink } from "../../blocks/shared/helpFn";
5
6 const SPFocalPointPicker = ({ label = "Focal Point", url = "", attributes, attributesKey, setAttributes, pro = false }) => {
7 const focalPointHandler = (newValue) => {
8 setAttributes({ [attributesKey]: newValue });
9 };
10 return (
11 <>
12 <div className={`sp-smart-post-focal-point sp-smart-post-component-mb${pro ? " sp-is-pro" : ""}`}>
13 <div className="sp-smart-post-header-control">
14 <div className="sp-smart-post-header-control-left">
15 <span className="sp-smart-post-component-title">
16 {label}
17 {pro && <a target="_blank" href={priceLink} className="sp-smart-pro-text">(Pro)</a>}
18 </span>
19 </div>
20 </div>
21 <div className="sp-smart-post-focal-point-control">
22 <FocalPointPicker
23 __nextHasNoMarginBottom
24 url={url}
25 value={attributes}
26 onChange={focalPointHandler}
27 />
28 </div>
29 </div>
30 </>
31 );
32 };
33
34 export default memo(SPFocalPointPicker);
35