From 47e77f9fac1155c536b2b87fec552c7fcce66fa6 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 01 Jun 2026 18:06:34 +0000
Subject: [PATCH] =Timeline block fixes. Next up: adding article schema classes
---
src/gmbreviews/edit.js | 69 ++++++++++++++++++++++++++++++++++
1 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/src/gmbreviews/edit.js b/src/gmbreviews/edit.js
new file mode 100644
index 0000000..7f7e09f
--- /dev/null
+++ b/src/gmbreviews/edit.js
@@ -0,0 +1,69 @@
+// src/gmbreviews/edit.js
+import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
+import { PanelBody, RangeControl, ToggleControl } from '@wordpress/components';
+import { __ } from '@wordpress/i18n';
+import ServerSideRender from '@wordpress/server-side-render';
+
+export default function Edit({ attributes, setAttributes }) {
+ const blockProps = useBlockProps();
+ const { count, inheritUser, showStats, minStars, showViewAllLink, showRating, showDate, showReviewLink } = attributes;
+
+ return (
+ <>
+ <InspectorControls>
+ <PanelBody title={__('Review Settings', 'jvb')}>
+ <ToggleControl
+ label={__('Inherit User', 'jvb')}
+ checked={inheritUser}
+ onChange={(value) => setAttributes({ inheritUser: value })}
+ />
+ <RangeControl
+ label={__('Number of Reviews', 'jvb')}
+ value={count}
+ onChange={(value) => setAttributes({ count: value })}
+ min={1}
+ max={20}
+ />
+ <ToggleControl
+ label={__('Show Rating', 'jvb')}
+ checked={showRating}
+ onChange={(value) => setAttributes({ showRating: value })}
+ />
+ <ToggleControl
+ label={__('Show Date', 'jvb')}
+ checked={showDate}
+ onChange={(value) => setAttributes({ showDate: value })}
+ />
+ <ToggleControl
+ label={__('Show Review Link', 'jvb')}
+ checked={showReviewLink}
+ onChange={(value) => setAttributes({ showReviewLink: value })}
+ />
+ <ToggleControl
+ label={__('Show Stats', 'jvb')}
+ checked={showStats}
+ onChange={(value) => setAttributes({ showStats: value })}
+ />
+ <ToggleControl
+ label={__('Show All Reviews Link', 'jvb')}
+ checked={showViewAllLink}
+ onChange={(value) => setAttributes({ showViewAllLink: value })}
+ />
+ <RangeControl
+ label={__('Minimum Rating', 'jvb')}
+ value={minStars}
+ onChange={(value) => setAttributes({ minStars: value })}
+ min={1}
+ max={5}
+ />
+ </PanelBody>
+ </InspectorControls>
+ <div {...blockProps}>
+ <ServerSideRender
+ block="jvb/gmbreviews"
+ attributes={attributes}
+ />
+ </div>
+ </>
+ );
+}
--
Gitblit v1.10.0