Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the RRS block placeholder labeling and improve spacing #61576

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}

Loading