|
1 | 1 | import { Card, FormLabel, Dialog } from '@automattic/components';
|
2 |
| -import { CheckboxControl } from '@wordpress/components'; |
| 2 | +import { Button, CheckboxControl } from '@wordpress/components'; |
3 | 3 | import { localize } from 'i18n-calypso';
|
4 | 4 | import { flowRight as compose } from 'lodash';
|
5 | 5 | import { Component } from 'react';
|
6 | 6 | import { connect } from 'react-redux';
|
7 | 7 | import QueryReaderTeams from 'calypso/components/data/query-reader-teams';
|
8 |
| -import FormButton from 'calypso/components/forms/form-button'; |
9 | 8 | import FormFieldset from 'calypso/components/forms/form-fieldset';
|
10 | 9 | import FormLegend from 'calypso/components/forms/form-legend';
|
11 | 10 | import FormSectionHeading from 'calypso/components/forms/form-section-heading';
|
@@ -80,6 +79,11 @@ class NotificationSubscriptions extends Component {
|
80 | 79 | this.props.submitForm( event );
|
81 | 80 | };
|
82 | 81 |
|
| 82 | + handleSubmitButtonClick = ( event ) => { |
| 83 | + this.props.recordGoogleEvent( 'Me', 'Clicked on Save Notification Settings Button' ); |
| 84 | + this.handleSubmit( event ); |
| 85 | + }; |
| 86 | + |
83 | 87 | handleModalCancel = () => {
|
84 | 88 | // Create a synthetic event object that matches what updateSetting expects
|
85 | 89 | const syntheticEvent = {
|
@@ -299,15 +303,14 @@ class NotificationSubscriptions extends Component {
|
299 | 303 | </FormFieldset>
|
300 | 304 | ) }
|
301 | 305 |
|
302 |
| - <FormButton |
303 |
| - isSubmitting={ this.props.isUpdatingUserSettings } |
| 306 | + <Button |
| 307 | + variant="primary" |
304 | 308 | disabled={ this.props.isUpdatingUserSettings || ! this.props.hasUnsavedUserSettings }
|
305 |
| - onClick={ this.handleClickEvent( 'Save Notification Settings Button' ) } |
| 309 | + isBusy={ this.props.isUpdatingUserSettings } |
| 310 | + onClick={ this.handleSubmitButtonClick } |
306 | 311 | >
|
307 |
| - { this.props.isUpdatingUserSettings |
308 |
| - ? this.props.translate( 'Saving…' ) |
309 |
| - : this.props.translate( 'Save notification settings' ) } |
310 |
| - </FormButton> |
| 312 | + { this.props.translate( 'Save notification settings' ) } |
| 313 | + </Button> |
311 | 314 | </form>
|
312 | 315 | </Card>
|
313 | 316 |
|
|
0 commit comments