Skip to content

Commit

Permalink
fix(dashboard): undo and redo buttons weird alignment (apache#16417)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
2 people authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent 9305127 commit 30346a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions superset-frontend/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -76,6 +77,7 @@ export default function Button(props: ButtonProps) {
cta,
children,
href,
showMarginRight = true,
...restProps
} = props;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/dashboard/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ class Header extends React.PureComponent {
buttonStyle={
this.state.emphasizeUndo ? 'primary' : undefined
}
showMarginRight={false}
>
<i
title="Undo"
Expand All @@ -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" />
Expand Down

0 comments on commit 30346a3

Please sign in to comment.