2017-01-27 11:58:15 +05:30
|
|
|
import React from 'react';
|
2020-06-04 22:11:27 +05:30
|
|
|
import { defineMessages, FormattedMessage as Message } from 'react-intl';
|
2017-05-26 00:41:57 +05:30
|
|
|
import { Link } from 'react-router-dom';
|
2019-12-08 00:32:00 +05:30
|
|
|
import FormComponent from 'app/components/ui/form/FormComponent';
|
2016-05-26 20:21:17 +05:30
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
import styles from './profileForm.scss';
|
2020-06-04 22:11:27 +05:30
|
|
|
|
|
|
|
const { back: backMsg } = defineMessages({
|
|
|
|
back: 'Back',
|
|
|
|
});
|
2016-05-26 20:21:17 +05:30
|
|
|
|
2018-03-26 00:46:45 +05:30
|
|
|
export class BackButton extends FormComponent<{
|
2020-05-24 04:38:24 +05:30
|
|
|
to: string;
|
2018-03-26 00:46:45 +05:30
|
|
|
}> {
|
2020-05-24 04:38:24 +05:30
|
|
|
static defaultProps = {
|
|
|
|
to: '/',
|
|
|
|
};
|
2019-11-27 14:33:32 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
render() {
|
|
|
|
const { to } = this.props;
|
2019-11-27 14:33:32 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
return (
|
|
|
|
<Link
|
|
|
|
className={styles.backButton}
|
|
|
|
to={to}
|
2020-06-04 22:11:27 +05:30
|
|
|
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}>
|
2020-06-04 22:11:27 +05:30
|
|
|
<Message {...backMsg} />
|
2020-05-24 04:38:24 +05:30
|
|
|
</span>
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
2016-05-26 20:21:17 +05:30
|
|
|
}
|