2016-12-03 15:54:15 +01:00
|
|
|
import React, { Component } from 'react';
|
2016-12-09 14:02:36 +01:00
|
|
|
import { List, ListItem, ListItemContent } from 'react-mdl';
|
2016-12-05 15:15:01 +01:00
|
|
|
import { Link } from 'react-router';
|
2016-12-03 15:54:15 +01:00
|
|
|
|
|
|
|
class ClientStrategies extends Component {
|
|
|
|
|
|
|
|
componentDidMount () {
|
2016-12-05 15:15:01 +01:00
|
|
|
this.props.fetchAll();
|
2016-12-03 15:54:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
2016-12-05 15:15:01 +01:00
|
|
|
const {
|
|
|
|
applications,
|
|
|
|
} = this.props;
|
2016-12-03 15:54:15 +01:00
|
|
|
|
2016-12-05 15:15:01 +01:00
|
|
|
if (!applications) {
|
|
|
|
return <div>loading...</div>;
|
|
|
|
}
|
2016-12-03 15:54:15 +01:00
|
|
|
return (
|
|
|
|
<div>
|
2016-12-09 14:02:36 +01:00
|
|
|
<h5>Applications</h5>
|
|
|
|
<hr />
|
|
|
|
<List>
|
|
|
|
{applications.map(({ appName, data = {} }) => (
|
|
|
|
<ListItem key={appName} twoLine>
|
|
|
|
<ListItemContent avatar={data.icon || 'apps'} subtitle={data.description}>
|
|
|
|
<Link to={`/applications/${appName}`}>
|
|
|
|
{appName}
|
|
|
|
</Link>
|
|
|
|
</ListItemContent>
|
|
|
|
</ListItem>
|
2016-12-05 15:15:01 +01:00
|
|
|
))}
|
2016-12-09 14:02:36 +01:00
|
|
|
</List>
|
2016-12-03 15:54:15 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default ClientStrategies;
|