mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00: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:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user