forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spacing control: Replace sides dropdwon with link button (WordPress#6…
…5193) * replace sides dropdown with link button for spacing control * remove sides dropdown * lowercase the link button tooltip * fix unit tests
- Loading branch information
1 parent
1664022
commit 632d8d6
Showing
5 changed files
with
61 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/block-editor/src/components/spacing-sizes-control/linked-button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { Button, Tooltip } from '@wordpress/components'; | ||
import { link, linkOff } from '@wordpress/icons'; | ||
import { __, sprintf } from '@wordpress/i18n'; | ||
|
||
export default function LinkedButton( { isLinked, ...props } ) { | ||
const label = isLinked | ||
? sprintf( | ||
// translators: 1. Type of spacing being modified (padding, margin, etc). | ||
__( 'Unlink %1$s' ), | ||
props.label.toLowerCase() | ||
).trim() | ||
: sprintf( | ||
// translators: 1. Type of spacing being modified (padding, margin, etc). | ||
__( 'Link %1$s' ), | ||
props.label.toLowerCase() | ||
).trim(); | ||
|
||
return ( | ||
<Tooltip text={ label }> | ||
<Button | ||
{ ...props } | ||
size="small" | ||
icon={ isLinked ? link : linkOff } | ||
iconSize={ 24 } | ||
aria-label={ label } | ||
/> | ||
</Tooltip> | ||
); | ||
} |
91 changes: 0 additions & 91 deletions
91
packages/block-editor/src/components/spacing-sizes-control/sides-dropdown/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters