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

View File

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