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 / admin / components / cards / Card.js

Card.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.8, at src/admin/components/cards/Card.js

68 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import Toggle from "react-toggle";
2 import { Demos, Docs } from "../icons/ui";
3 import ProBadge from "../badges/ProBadge";
4
5 // Blocks settings page block on/off card component.
6 const Card = ({ blockName, attributes, blockShowHideHandler, blocksSettings, type = "" }) => {
7 const findBlockData = blocksSettings?.find((item) => blockName === item.block_name);
8
9 if (!findBlockData) {
10 return;
11 }
12
13 const { show } = findBlockData;
14
15 const Icon = attributes?.Icon || null;
16 const demoLink = attributes?.demoLink || null;
17 const docLink = attributes?.docLink || null;
18 const title = attributes?.title || null;
19 const pro = attributes?.pro || null;
20
21 return (
22 <div className={`sp-pcp-blocks-settings-card${pro ? " sp-pcp-pro-card" : ""}`}>
23 <div className="sp-pcp-blocks-settings-card-info">
24 {pro && <ProBadge />}
25 <div className="sp-pcp-blocks-settings-card-icon">
26 <Icon />
27 </div>
28 <div className="sp-pcp-blocks-settings-card-docs">
29 <div className="sp-pcp-blocks-settings-card-title">
30 <h4>{title}</h4>
31 {/* {("setup-wizard" !== type && pro) && <ProBadge />} */}
32 </div>
33 {"setup-wizard" !== type && <ul>
34 {"quick-start" !== type && <li>
35 <a target="_blank" href={docLink} rel="noreferrer">
36 <Docs /> Docs
37 </a>
38 </li>}
39 <li>
40 {/* <a target="_blank" href={ demoLink }> */}
41 {demoLink && (
42 <a target="_blank" href={demoLink || null} rel="noreferrer">
43 <Demos /> {"quick-start" === type ? "Live Demo" : "Demo"}
44 </a>
45 )}
46 </li>
47 </ul>}
48 </div>
49 </div>
50
51 <div className="sp-pcp-blocks-settings-toggle-btn">
52 <Toggle
53 defaultChecked={pro ? false : show}
54 icons={false}
55 onChange={() => {
56 if (!pro) {
57 blockShowHideHandler(blockName);
58 }
59 }}
60 disabled={pro}
61 />
62 </div>
63 </div>
64 );
65 };
66
67 export default Card;
68