2017-01-27 08:28:15 +02:00
|
|
|
import React from 'react';
|
2020-06-04 19:41:27 +03:00
|
|
|
import { defineMessages, FormattedMessage as Message } from 'react-intl';
|
2017-05-25 22:11:57 +03:00
|
|
|
import { Link } from 'react-router-dom';
|
2019-12-07 21:02:00 +02:00
|
|
|
import FormComponent from 'app/components/ui/form/FormComponent';
|
2016-05-26 17:51:17 +03:00
|
|
|
|
2019-12-07 21:02:00 +02:00
|
|
|
import styles from './profileForm.scss';
|
2020-06-04 19:41:27 +03:00
|
|
|
|
|
|
|
const { back: backMsg } = defineMessages({
|
|
|
|
back: 'Back',
|
|
|
|
});
|
2016-05-26 17:51:17 +03:00
|
|
|
|
2018-03-25 22:16:45 +03:00
|
|
|
export class BackButton extends FormComponent<{
|
2020-05-24 02:08:24 +03:00
|
|
|
to: string;
|
2018-03-25 22:16:45 +03:00
|
|
|
}> {
|
2020-05-24 02:08:24 +03:00
|
|
|
static defaultProps = {
|
|
|
|
to: '/',
|
|
|
|
};
|
2019-11-27 11:03:32 +02:00
|
|
|
|
2020-05-24 02:08:24 +03:00
|
|
|
render() {
|
|
|
|
const { to } = this.props;
|
2019-11-27 11:03:32 +02:00
|
|
|
|
2020-05-24 02:08:24 +03:00
|
|
|
return (
|
|
|
|
<Link
|
|
|
|
className={styles.backButton}
|
|
|
|
to={to}
|
2020-06-04 19:41:27 +03:00
|
|
|
title={this.formatMessage(backMsg)}
|
2020-05-24 02:08:24 +03:00
|
|
|
data-testid="back-to-profile"
|
|
|
|
>
|
|
|
|
<span className={styles.backIcon} />
|
|
|
|
<span className={styles.backText}>
|
2020-06-04 19:41:27 +03:00
|
|
|
<Message {...backMsg} />
|
2020-05-24 02:08:24 +03:00
|
|
|
</span>
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
2016-05-26 17:51:17 +03:00
|
|
|
}
|