mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Rework Button component to pass its label via children content
This commit is contained in:
@@ -7,7 +7,6 @@ import mfaStyles from './mfa.scss';
|
||||
|
||||
const messages = defineMessages({
|
||||
codePlaceholder: 'Enter the code here',
|
||||
disable: 'Disable',
|
||||
});
|
||||
|
||||
export default class MfaDisableForm extends React.Component<{
|
||||
@@ -49,7 +48,9 @@ export default class MfaDisableForm extends React.Component<{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button type="submit" color="green" block label={messages.disable} />
|
||||
<Button type="submit" color="green" block>
|
||||
<Message key="disable" defaultMessage="Disable" />
|
||||
</Button>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
import React from 'react';
|
||||
import { FormattedMessage as Message, defineMessages } from 'react-intl';
|
||||
|
||||
import { Button, FormModel } from 'app/components/ui/form';
|
||||
import styles from 'app/components/profile/profileForm.scss';
|
||||
import Stepper from 'app/components/ui/stepper';
|
||||
@@ -7,7 +9,6 @@ import { ScrollIntoView } from 'app/components/ui/scroll';
|
||||
import logger from 'app/services/logger';
|
||||
import { getSecret, enable as enableMFA } from 'app/services/api/mfa';
|
||||
import { Form } from 'app/components/ui/form';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import Context from '../Context';
|
||||
import Instructions from './instructions';
|
||||
@@ -105,7 +106,9 @@ export default class MfaEnable extends React.PureComponent<Props, State> {
|
||||
|
||||
{this.renderStepForms()}
|
||||
|
||||
<Button color="green" onClick={buttonAction} loading={isLoading} block label={buttonLabel} />
|
||||
<Button color="green" onClick={buttonAction} loading={isLoading} block>
|
||||
<Message {...buttonLabel} />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user