Rework Button component to pass its label via children content

This commit is contained in:
ErickSkrauch
2020-07-22 14:20:10 +03:00
parent 993d0cdedb
commit d84497ac28
17 changed files with 175 additions and 152 deletions

View File

@@ -1,15 +1,11 @@
import React from 'react';
import { defineMessages, FormattedMessage as Message } from 'react-intl';
import { FormattedMessage as Message } from 'react-intl';
import { Helmet } from 'react-helmet-async';
import { Input, Button, Form, FormModel } from 'app/components/ui/form';
import { BackButton } from 'app/components/profile/ProfileForm';
import styles from '../profileForm.scss';
const labels = defineMessages({
changeUsernameButton: 'Change nickname',
});
interface Props {
username: string;
form: FormModel;
@@ -72,7 +68,9 @@ export default class ChangeUsername extends React.Component<Props> {
</div>
</div>
<Button color="green" block label={labels.changeUsernameButton} type="submit" />
<Button color="green" block type="submit">
<Message key="changeUsernameButton" defaultMessage="Change nickname" />
</Button>
</div>
</div>
</Form>