Skip to content

Commit

Permalink
Fix the RSS block placeholder labeling and improve spacing (WordPress…
Browse files Browse the repository at this point in the history
…#61576)

* Fix labeling of the RSS block placeholder.

* Fix RSS placeholder spacing.

Co-authored-by: afercia <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored May 12, 2024
1 parent 0a1cc1f commit f73d44e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
47 changes: 27 additions & 20 deletions packages/block-library/src/rss/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
RangeControl,
ToggleControl,
ToolbarGroup,
__experimentalHStack as HStack,
__experimentalInputControl as InputControl,
} from '@wordpress/components';
import { useState } from '@wordpress/element';
Expand Down Expand Up @@ -59,32 +58,40 @@ export default function RSSEdit( { attributes, setAttributes } ) {

const blockProps = useBlockProps();

const label = __( 'RSS URL' );

if ( isEditing ) {
return (
<div { ...blockProps }>
<Placeholder icon={ rss } label="RSS">
<Placeholder
icon={ rss }
label={ label }
instructions={ __(
'Display entries from any RSS or Atom feed.'
) }
>
<form
onSubmit={ onSubmitURL }
className="wp-block-rss__placeholder-form"
>
<HStack wrap>
<InputControl
__next40pxDefaultSize
placeholder={ __( 'Enter URL here…' ) }
value={ feedURL }
onChange={ ( value ) =>
setAttributes( { feedURL: value } )
}
className="wp-block-rss__placeholder-input"
/>
<Button
__next40pxDefaultSize
variant="primary"
type="submit"
>
{ __( 'Use URL' ) }
</Button>
</HStack>
<InputControl
__next40pxDefaultSize
label={ label }
hideLabelFromVision
placeholder={ __( 'Enter URL here…' ) }
value={ feedURL }
onChange={ ( value ) =>
setAttributes( { feedURL: value } )
}
className="wp-block-rss__placeholder-input"
/>
<Button
__next40pxDefaultSize
variant="primary"
type="submit"
>
{ __( 'Apply' ) }
</Button>
</form>
</Placeholder>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/rss/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
}

.wp-block-rss__placeholder-input {
flex: 1;
min-width: 80%;
margin: 0 8px 0 0;
flex: 1 1 auto;
}
}

0 comments on commit f73d44e

Please sign in to comment.