Commit a97955cf authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

fixed cooperator details page

parent a577a639
{
"cooperator": {
"public": {
"p": {
"login": {
"youLoggedIn": "You logged in as {{username}}"
}
}
},
"admin": {
"p": {
"browse": {
"title": "List of users"
"title": "List of cooperators"
},
"details": {
"title": "Your cooperator"
}
}
}
......
{
"public": {
"p": {
"login": {
"youLoggedIn": "You logged in as {{username}}"
}
}
},
"admin": {
"p": {
"browse": {
"title": "List of users"
"title": "List of cooperators"
},
"details": {
"title": "Your cooperator"
}
}
}
......
......@@ -6,6 +6,8 @@ import { WithTranslation, withTranslation } from 'react-i18next';
import { getCooperatorAction } from 'cooperator/action/public';
// Model
import Cooperator from '@gringlobal/client/model/gringlobal/Cooperator';
// Ui
import BackButton from '@gringlobal/client/ui/common/button/BackButton';
interface ICooperatorDetailsPage extends React.ClassAttributes<any>, WithTranslation {
......@@ -25,10 +27,14 @@ class CooperatorDetailsPage extends React.Component<ICooperatorDetailsPage> {
}
public render() { // TODO add t
const { cooperator } = this.props;
const { cooperator, t } = this.props;
return cooperator ? (
<div>
{ JSON.stringify(cooperator) }
<h3>{ t('express:cooperator.public.p.details.title') }</h3>
<pre>
{ JSON.stringify(cooperator, null, '\t') }
</pre>
<BackButton/>
</div>
) : null;
}
......@@ -36,8 +42,8 @@ class CooperatorDetailsPage extends React.Component<ICooperatorDetailsPage> {
}
const mapStateToProps = (state, ownProps) => ({
user: state.user.public.user,
uuid: ownProps.match.params.uuid,
cooperator: state.cooperator.public.cooperator,
id: ownProps.match.params.id,
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
......@@ -46,6 +52,6 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
export default compose<ICooperatorDetailsPage>(
withTranslation,
withTranslation(),
connect(mapStateToProps, mapDispatchToProps),
)(CooperatorDetailsPage) as ICooperatorDetailsPage;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment