PluginProbe
Gianism / trunk
Gianism vtrunk
4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.4.0 5.0.0 5.0.1 5.0.2 5.1.0 5.2.1 5.2.2 5.3.0 6.0.0 6.0.1 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 65 releases
gianism / src / blocks / login / edit.js

edit.js in Gianism trunk, at src/blocks/login/edit.js

31 lines 914 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
3 import { PanelBody, TextControl } from '@wordpress/components';
4 import ServerSideRender from '@wordpress/server-side-render';
5 import './editor.scss';
6
7 export default function Edit( { attributes, setAttributes } ) {
8 const { redirectTo } = attributes;
9
10 return (
11 <>
12 <InspectorControls>
13 <PanelBody title={ __( 'Settings', 'wp-gianism' ) }>
14 <TextControl
15 label={ __( 'Redirect URL', 'wp-gianism' ) }
16 help={ __( 'URL to redirect after login. Leave empty for current page.', 'wp-gianism' ) }
17 value={ redirectTo }
18 onChange={ ( value ) => setAttributes( { redirectTo: value } ) }
19 />
20 </PanelBody>
21 </InspectorControls>
22 <div { ...useBlockProps() }>
23 <ServerSideRender
24 block="gianism/login"
25 attributes={ attributes }
26 />
27 </div>
28 </>
29 );
30 }
31