Skip to content

Commit ddc8a2b

Browse files
UI tweaks
1 parent 7e476ce commit ddc8a2b

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

src/components/block-styles-control/editor.scss

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
background-color: var(--stk-skin-bg-secondary);
3333
color: var(--stk-skin-dark);
3434
}
35+
36+
.stk-panel-modified-indicator {
37+
display: inline-block;
38+
margin-inline: 8px;
39+
}
3540
}
3641

3742
.ugb-block-styles__new-style-modal {
@@ -80,10 +85,6 @@
8085
}
8186
.components-button {
8287
width: 100%;
83-
position: relative;
84-
padding: 0 4px;
85-
height: 28px;
86-
outline: 1px solid #e0e0e0;
8788

8889
&.ugb-block-styles-controls__selected {
8990
outline: 2px solid var(--stk-skin-dark) !important;
@@ -106,11 +107,8 @@
106107
margin-inline-start: 24px;
107108
}
108109

109-
.ugb-block-styles-controls__action {
110-
margin: 0 auto;
111-
display: inline-flex;
112-
align-items: center;
113-
gap: 4px;
110+
.stk-pulsating-circle {
111+
margin-inline-start: 8px;
114112
}
115113

116114
.ugb-control-separator {

src/components/block-styles-control/index.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import ProControl from '../pro-control'
55
import { ResetButton } from '../base-control2/reset-button'
6-
import ControlSeparator from '../control-separator'
76
import Button from '../button'
87
import {
98
useBlockAttributesContext,
@@ -26,6 +25,8 @@ import {
2625
Dashicon,
2726
Popover,
2827
PanelBody,
28+
Flex,
29+
FlexItem,
2930
} from '@wordpress/components'
3031
import {
3132
Fragment,
@@ -150,7 +151,6 @@ export const BlockStylesControl = props => {
150151
className="ugb-block-styles-controls__block-style-button"
151152
size="small"
152153
icon="edit"
153-
iconPosition="right"
154154
iconSize={ 12 }
155155
onClick={ () => {
156156
// Clicking this button when the popover is open also triggers the popover's `onClose`, so the popover will close automatically.
@@ -160,7 +160,7 @@ export const BlockStylesControl = props => {
160160
} }
161161
ref={ buttonRef }
162162
>
163-
{ `${ __( 'Block Style', i18n ) }:` } <wbr /> { blockStyleLabel }{ isModified && inBlockStyleOptions ? ` (${ __( 'Modified', i18n ) })` : '' }
163+
{ `${ __( 'Block Style', i18n ) }:` } <wbr /> { blockStyleLabel }{ isModified && inBlockStyleOptions ? <span className="stk-panel-modified-indicator stk--visible"></span> : '' }
164164

165165
</Button>
166166
<ResetButton
@@ -196,6 +196,7 @@ export const BlockStylesControl = props => {
196196
} }
197197
anchor={ buttonRef.current }
198198
offset={ 8 }
199+
placement="left"
199200
>
200201
<PanelBody>
201202
<h2 className="components-panel__body-title">{ __( 'Block Styles', i18n ) }</h2>
@@ -276,22 +277,24 @@ const SaveUpdateButtons = props => {
276277
}
277278

278279
return ( <>
279-
<ControlSeparator style={ { width: '100% !important', margin: '0 auto !important' } } />
280-
<ul>
281-
<UpdateButton
282-
blockStyle={ blockStyle }
283-
inOptions={ inOptions }
284-
isModified={ isModified }
285-
setOpenSaveModal={ setOpenSaveModal }
286-
/>
287-
<li>
288-
<Button onClick={ () => onAddBlockStyle() }>
289-
<span className="ugb-block-styles-controls__action">
290-
{ __( 'Add new block style', i18n ) }
291-
{ ! isPro && <span className="stk-pulsating-circle" role="presentation" /> }
292-
</span>
280+
<Flex style={ { marginTop: '24px' } }>
281+
<FlexItem>
282+
<UpdateButton
283+
blockStyle={ blockStyle }
284+
inOptions={ inOptions }
285+
isModified={ isModified }
286+
setOpenSaveModal={ setOpenSaveModal }
287+
/>
288+
</FlexItem>
289+
<FlexItem>
290+
<Button
291+
variant="primary"
292+
onClick={ () => onAddBlockStyle() }
293+
>
294+
{ __( 'Save as New Style', i18n ) }
295+
{ ! isPro && <span className="stk-pulsating-circle" role="presentation" /> }
293296
</Button>
294-
</li>
295-
</ul>
297+
</FlexItem>
298+
</Flex>
296299
</> )
297300
}

0 commit comments

Comments
 (0)