| 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 |
|