34 lines
897 B
TypeScript
Raw Normal View History

2017-01-27 08:28:15 +02:00
import React from 'react';
import { 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';
import messages from './ProfileForm.intl.json';
export class BackButton extends FormComponent<{
2020-05-24 02:08:24 +03:00
to: string;
}> {
2020-05-24 02:08:24 +03:00
static defaultProps = {
to: '/',
};
2020-05-24 02:08:24 +03:00
render() {
const { to } = this.props;
2020-05-24 02:08:24 +03:00
return (
<Link
className={styles.backButton}
to={to}
title={this.formatMessage(messages.back)}
data-testid="back-to-profile"
>
<span className={styles.backIcon} />
<span className={styles.backText}>
<Message {...messages.back} />
</span>
</Link>
);
}
}