accounts-frontend/packages/app/components/profile/ProfileForm.tsx

37 lines
919 B
TypeScript
Raw Permalink Normal View History

2017-01-27 11:58:15 +05:30
import React from 'react';
import { defineMessages, FormattedMessage as Message } from 'react-intl';
import { Link } from 'react-router-dom';
import FormComponent from 'app/components/ui/form/FormComponent';
import styles from './profileForm.scss';
const { back: backMsg } = defineMessages({
back: 'Back',
});
export class BackButton extends FormComponent<{
2020-05-24 04:38:24 +05:30
to: string;
}> {
2020-05-24 04:38:24 +05:30
static defaultProps = {
to: '/',
};
2020-05-24 04:38:24 +05:30
render() {
const { to } = this.props;
2020-05-24 04:38:24 +05:30
return (
<Link
className={styles.backButton}
to={to}
title={this.formatMessage(backMsg)}
2020-05-24 04:38:24 +05:30
data-testid="back-to-profile"
>
<span className={styles.backIcon} />
<span className={styles.backText}>
<Message {...backMsg} />
2020-05-24 04:38:24 +05:30
</span>
</Link>
);
}
}