fix(dashboard): undo and redo buttons weird alignment (#16417)

* fix(dashboard-ui): undo and redo buttons weird alignment

* fix(Explore control pane): keyboard nav & focus

* lint: lint frontend

* fix: fix redo and undo button style

* lint: lint line

* lint: lint line

Co-authored-by: xuzhebin <maxhui2020@gmail.com>
This commit is contained in:
Maxhui 2021-08-25 19:52:59 +08:00 committed by GitHub
parent 08b8aa277f
commit 6a2cec51c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -63,6 +63,7 @@ export interface ButtonProps {
htmlType?: 'button' | 'submit' | 'reset';
cta?: boolean;
loading?: boolean | { delay?: number | undefined } | undefined;
showMarginRight?: boolean;
}
export default function Button(props: ButtonProps) {
@ -76,6 +77,7 @@ export default function Button(props: ButtonProps) {
cta,
children,
href,
showMarginRight = true,
...restProps
} = props;
@ -154,8 +156,8 @@ export default function Button(props: ButtonProps) {
} else {
renderedChildren = Children.toArray(children);
}
const firstChildMargin = renderedChildren.length > 1 ? theme.gridUnit * 2 : 0;
const firstChildMargin =
showMarginRight && renderedChildren.length > 1 ? theme.gridUnit * 2 : 0;
const button = (
<AntdButton

View File

@ -526,6 +526,7 @@ class Header extends React.PureComponent {
buttonStyle={
this.state.emphasizeUndo ? 'primary' : undefined
}
showMarginRight={false}
>
<i
title="Undo"
@ -541,6 +542,7 @@ class Header extends React.PureComponent {
buttonStyle={
this.state.emphasizeRedo ? 'primary' : undefined
}
showMarginRight={false}
>
&nbsp;
<i title="Redo" className="redo-action fa fa-share" />