mirror of https://github.com/apache/superset.git
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:
parent
08b8aa277f
commit
6a2cec51c5
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
>
|
||||
|
||||
<i title="Redo" className="redo-action fa fa-share" />
|
||||
|
|
Loading…
Reference in New Issue