PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / blocks / doc-author / src / edit.js

edit.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/blocks/doc-author/src/edit.js

63 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useBlockProps } from "@wordpress/block-editor";
2 import { timeIcon } from "../icons/icons";
3 import Inspector from "./inspector";
4 import {
5 usePreviewDeviceType,
6 useDuplicateBlockIdFix,
7 useStyleSheets,
8 } from "../../../hooks";
9 import cssProperties from "./cssProperties";
10 import { getCurrentDate } from "./helpers";
11
12 const BLOCK_PREFIX = "betterdocs-doc-author";
13 const Edit = ({ attributes, setAttributes, isSelected, clientId }) => {
14 const { blockId } = attributes;
15
16 const blockProps = useBlockProps({
17 className: `eb-guten-block-main-parent-wrapper`,
18 });
19
20 usePreviewDeviceType(setAttributes);
21 useDuplicateBlockIdFix(BLOCK_PREFIX, blockId, clientId, setAttributes);
22
23 const { casecadeStyles, styleTag } = useStyleSheets({
24 properties: cssProperties({ blockId }),
25 setAttributes,
26 attributes,
27 });
28
29 return (
30 <>
31 {isSelected && (
32 <Inspector
33 attributes={attributes}
34 setAttributes={setAttributes}
35 />
36 )}
37 <div {...blockProps}>
38 {styleTag()}
39 <div className={blockId}>
40 <div className="betterdocs-author-date">
41 <div className="betterdocs-author">
42 <div className="author-avatar">
43 <img
44 alt=""
45 src="http://0.gravatar.com/avatar/?s=40&amp;d=mm&amp;r=g"
46 srcset="http://2.gravatar.com/avatar/?s=80&amp;d=mm&amp;r=g 2x"
47 class="avatar avatar-40 photo avatar-default"
48 height="40"
49 width="40"
50 decoding="async"
51 />
52 </div>
53 <span>User Name</span>
54 </div>
55 <div className="update-date">{getCurrentDate()}</div>
56 </div>
57 </div>
58 </div>
59 </>
60 );
61 };
62 export default Edit;
63