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

Add loading animation for save and edit buttons. #956

Merged
merged 4 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Changes

- Add loading animation for save and edit buttons in toolbar @pgrunewald
- Move Body class depending on content type to `App` component in order to make it available everywhere @sneridagh
- Add root class name to `Tags` component @sneridagh

Expand Down
10 changes: 6 additions & 4 deletions src/components/manage/Add/Add.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { connect } from 'react-redux';
import { compose } from 'redux';
import { keys } from 'lodash';
import { defineMessages, injectIntl } from 'react-intl';
import { Button } from 'semantic-ui-react';
import { Portal } from 'react-portal';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
Expand Down Expand Up @@ -193,20 +194,21 @@ class Add extends Component {
hideDefaultViewButtons
inner={
<>
<button
<Button
id="toolbar-save"
className="save"
aria-label={this.props.intl.formatMessage(messages.save)}
onClick={() => this.form.current.onSubmit()}
loading={this.props.createRequest.loading}
>
<Icon
name={saveSVG}
className="circled"
size="30px"
title={this.props.intl.formatMessage(messages.save)}
/>
</button>
<button className="cancel" onClick={() => this.onCancel()}>
</Button>
<Button className="cancel" onClick={() => this.onCancel()}>
<Icon
name={clearSVG}
className="circled"
Expand All @@ -216,7 +218,7 @@ class Add extends Component {
size="30px"
title={this.props.intl.formatMessage(messages.cancel)}
/>
</button>
</Button>
</>
}
/>
Expand Down
10 changes: 6 additions & 4 deletions src/components/manage/Edit/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { defineMessages, injectIntl } from 'react-intl';
import { Button } from 'semantic-ui-react';
import { Portal } from 'react-portal';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
Expand Down Expand Up @@ -199,20 +200,21 @@ class Edit extends Component {
hideDefaultViewButtons
inner={
<>
<button
<Button
id="toolbar-save"
className="save"
aria-label={this.props.intl.formatMessage(messages.save)}
onClick={() => this.form.current.onSubmit()}
loading={this.props.updateRequest.loading}
>
<Icon
name={saveSVG}
className="circled"
size="30px"
title={this.props.intl.formatMessage(messages.save)}
/>
</button>
<button
</Button>
<Button
className="cancel"
aria-label={this.props.intl.formatMessage(messages.cancel)}
onClick={() => this.onCancel()}
Expand All @@ -223,7 +225,7 @@ class Edit extends Component {
size="30px"
title={this.props.intl.formatMessage(messages.cancel)}
/>
</button>
</Button>
</>
}
/>
Expand Down
7 changes: 7 additions & 0 deletions theme/themes/pastanaga/extras/toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
&:focus {
outline: none;
}

&.ui {
margin-right: 0;
svg.icon {
margin: 0;
}
}
}
}

Expand Down