PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.4
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.4
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 / shortcode / dynamicShortcode.js

dynamicShortcode.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.4, at src/blocks/shortcode/dynamicShortcode.js

26 lines 846 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from "@wordpress/i18n";
2
3 const DynamicShortcodeInput = ({ attributes: { shortcode }, shortCodeList, shortcodeUpdate }) => {
4 return (
5 <div className="spsp-gutenberg-shortcode editor-styles-wrapper">
6 <select className="spsp-shortcode-selector" onChange={(e) => shortcodeUpdate(e)} value={shortcode}>
7 <option value="0">{__("-- Select a Show --", "post-carousel")}</option>
8 {shortCodeList.map((shortcodeItem) => {
9 const title =
10 shortcodeItem.title.length > 35
11 ? `${shortcodeItem.title.substring(0, 30)}.... #(${shortcodeItem.id})`
12 : `${shortcodeItem.title} #(${shortcodeItem.id})`;
13
14 return (
15 <option key={shortcodeItem.id.toString()} value={shortcodeItem.id.toString()}>
16 {title}
17 </option>
18 );
19 })}
20 </select>
21 </div>
22 );
23 };
24
25 export default DynamicShortcodeInput;
26