Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dashboard): undo and redo buttons weird alignment #16417

Merged
merged 6 commits into from
Aug 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions superset-frontend/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions superset-frontend/src/dashboard/components/Header/index.jsx
Original file line number Diff line number Diff line change
@@ -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}
>
&nbsp;
<i title="Redo" className="redo-action fa fa-share" />