Skip to content

Commit c3cb7e2

Browse files
committed
hide other disabled insert button
1 parent f854eab commit c3cb7e2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/design-library-list/design-library-list-item.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const DesignLibraryListItem = memo( props => {
4545
const { hostRef, shadowRoot } = useShadowRoot( shouldRender )
4646

4747
const ref = useRef( null )
48+
const insertButtonRef = useRef( null )
4849

4950
const {
5051
blocks, enableBackground,
@@ -150,10 +151,16 @@ const DesignLibraryListItem = memo( props => {
150151
{ selectedTab === 'patterns' ? <span className="stk-block-design__selected-num">{ selectedNum === 0 ? '' : selectedNum }</span>
151152
: <div>
152153
<Button
154+
ref={ insertButtonRef }
153155
label={ __( 'Insert', i18n ) }
154156
className="ugb-modal-design-library__add-multi"
155157
disabled={ isMultiSelectBusy }
156-
onClick={ () => onClickDesign() }
158+
onClick={ () => {
159+
if ( insertButtonRef.current ) {
160+
insertButtonRef.current.style.opacity = 1
161+
}
162+
onClickDesign()
163+
} }
157164
>
158165
{ __( 'Insert', i18n ) }
159166
{ isMultiSelectBusy && <Spinner /> }

src/components/modal-design-library/editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
text-transform: uppercase;
175175
&[disabled] {
176176
background: #efefef;
177-
opacity: 1;
177+
// opacity: 1;
178178
}
179179
&:not([disabled]) {
180180
background: linear-gradient(131.34deg, #ee006b -0.77%, #b300be 94.57%);

0 commit comments

Comments
 (0)