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 / thumbnail-slider-two / block.js

block.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.8, at src/blocks/thumbnail-slider-two/block.js

36 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { registerBlockType } from "@wordpress/blocks";
2 import generateBlockCSS from "../shared/generateBlockCSS";
3 import { isBlockEnabled } from "../../utils";
4 import SaveComponent from "../shared/SaveComponent";
5 import PostThumbnailTwoEdit from "./edit";
6 import { PostThumbnailSliderTwoBlockIcon, PostThumbnailsSliderTwoPreviewImage } from "./icon";
7
8 const options = {
9 apiVersion: 3,
10 icon: PostThumbnailSliderTwoBlockIcon,
11 category: "sp-smart-post-show-pro-blocks",
12 name: "sp-smart-post-show/thumbnail-slider-two",
13 title: "Thumbnails Slider 02",
14 description: "Display posts in a modern slider with internal thumbs navigation.",
15 supports: {
16 align: ["wide", "full"],
17 },
18 example: {
19 attributes: {
20 isPreview: true,
21 },
22 },
23 edit: (props) =>
24 props.attributes.isPreview ? <PostThumbnailsSliderTwoPreviewImage /> : <PostThumbnailTwoEdit {...props} />,
25 save: SaveComponent,
26 generateCSS: (attributes) => generateBlockCSS(attributes, "sp-smart-post-show/thumbnail-slider-two", "frontend"),
27 };
28
29 const registerBlockTypeFn = () => {
30 if (isBlockEnabled(options.name)) {
31 registerBlockType(options.name, options);
32 }
33 };
34
35 registerBlockTypeFn();
36