Skip to content

Commit

Permalink
Rely on Text component instead of Truncate (#65007)
Browse files Browse the repository at this point in the history
Co-authored-by: SantosGuillamot <[email protected]>
Co-authored-by: cbravobernal <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 18164f0 commit ebabad6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions packages/block-editor/src/hooks/block-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
__experimentalText as Text,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
__experimentalTruncate as Truncate,
__experimentalVStack as VStack,
privateApis as componentsPrivateApis,
} from '@wordpress/components';
Expand Down Expand Up @@ -98,19 +97,17 @@ function BlockBindingsAttribute( { attribute, binding } ) {
unlock( blocksPrivateApis ).getBlockBindingsSource( sourceName );
const isSourceInvalid = ! sourceProps;
return (
<VStack>
<Truncate>{ attribute }</Truncate>
<VStack className="block-editor-bindings__item">
<Text truncate>{ attribute }</Text>
{ !! binding && (
<Text
truncate
variant={ ! isSourceInvalid && 'muted' }
className="block-editor-bindings__item-explanation"
isDestructive={ isSourceInvalid }
>
<Truncate>
{ isSourceInvalid
? __( 'Invalid source' )
: args?.key || sourceProps?.label || sourceName }
</Truncate>
{ isSourceInvalid
? __( 'Invalid source' )
: args?.key || sourceProps?.label || sourceName }
</Text>
) }
</VStack>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/block-bindings.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
div.block-editor-bindings__panel {
grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
button:hover .block-editor-bindings__item-explanation {
button:hover .block-editor-bindings__item span {
color: inherit;
}
}

0 comments on commit ebabad6

Please sign in to comment.