Commit 62aaf065 authored by Oleksii Savran's avatar Oleksii Savran
Browse files

Added crops to entry page

parent f0f6cd05
......@@ -19,6 +19,8 @@ import MailOutlineIcon from '@material-ui/icons/MailOutline';
import BookmarkBorderIcon from '@material-ui/icons/BookmarkBorder';
import PageLayout from 'ui/layout/PageLayout';
import Number from 'ui/common/Number';
import GridLayout from 'ui/layout/GridLayout';
import CropCard from 'crop/ui/c/CropCard';
const styles = (theme) => ({
/* tslint:disable */
......@@ -235,7 +237,7 @@ class WelcomePage extends React.Component<any, any> {
}
public render() {
const { classes, t, serverInfo } = this.props;
const { classes, t, serverInfo, crops } = this.props;
const Stats = ({children}) => (
<div className={ classes.stats }>
......@@ -432,6 +434,13 @@ share caracterization and evaluation information on material held in their colle
</Grid>
</Grid>
</Grid>
<Grid item xs={ 12 }>
{ crops &&
<GridLayout style={ { width: 'auto', margin: '8px 6px' } }>
{ crops && crops.sort((a, b) => a.name.localeCompare(b.name)).map((crop) => <CropCard key={ crop.shortName } crop={ crop } compact />) }
</GridLayout>
}
</Grid>
</PageLayout>
);
}
......@@ -439,6 +448,7 @@ share caracterization and evaluation information on material held in their colle
const mapStateToProps = (state) => ({
serverInfo: state.serverInfo.data,
crops: state.crop.public.list || undefined,
// accessToken: state.login.access_token,
});
......
Supports Markdown
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