Update "new form" block action

This commit is contained in:
Michael Thomas 2022-02-17 21:34:14 -05:00
parent 5c96a82651
commit 054ceef45e
1 changed files with 15 additions and 6 deletions

View File

@ -9,7 +9,6 @@ import {
PanelRow,
ExternalLink,
Button,
Icon,
} from '@wordpress/components';
import { edit, external } from '@wordpress/icons';
import { useState } from '@wordpress/element';
@ -75,19 +74,29 @@ const Edit: React.FC<BlockEditProps<IBlockAttributes>> = ( { attributes, setAttr
/>
</div>
:
// No form has been selected yet, so render the placeholder
// No form has been selected yet, so render the placeholder.
<div>
<Placeholder
icon={ CogIcon }
label="Cognito Forms"
instructions="Choose an existing form to embed or create a new one."
>
<div>
<Button isPrimary onClick={ () => setSelectDialogOpen( true ) }>
<div style={ { display: 'flex' } }>
<Button
variant="primary"
onClick={ () => setSelectDialogOpen( true ) }
>
Select Form
</Button>
<Button isTertiary href={ `${ baseUrl }/forms/new` } target="_blank">
New Form&thinsp;<Icon icon={ external } size={ 16 }></Icon>
<Button
href={ `${ baseUrl }/forms/new` }
target="_blank"
icon={ external }
iconPosition="right"
iconSize={ 16 }
variant="secondary"
>
New Form
</Button>
</div>
</Placeholder>