mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
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';
|
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
|
||||||
|
@ -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}
|
||||||
>
|
>
|
||||||
|
|
||||||
<i title="Redo" className="redo-action fa fa-share" />
|
<i title="Redo" className="redo-action fa fa-share" />
|
||||||
|
Loading…
Reference in New Issue
Block a user