Commit cb3c0491 authored by Florent Chehab's avatar Florent Chehab
Browse files

UnivMap Reload button added

parent 91250689
......@@ -7,6 +7,7 @@ import { withStyles } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import Drawer from '@material-ui/core/Drawer';
import List from '@material-ui/core/List';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import Divider from '@material-ui/core/Divider';
import IconButton from '@material-ui/core/IconButton';
......@@ -14,11 +15,16 @@ import MenuIcon from '@material-ui/icons/Menu';
import Chip from '@material-ui/core/Chip';
import Avatar from '@material-ui/core/Avatar';
import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
import ScoolIcon from '@material-ui/icons/School';
import UnivMap from './UnivMap'
import SchoolIcon from '@material-ui/icons/School';
import UnivMap from './UnivMap';
import UnivMapReloadButton from './UnivMapReloadButton';
import Paper from '@material-ui/core/Paper';
import { mainListItems, secondaryListItems } from './listItems';
import {
universitiesInvalidated
} from '../actions/universities';
const drawerWidth = 240;
const styles = theme => ({
......@@ -35,7 +41,6 @@ const styles = theme => ({
padding: '0 8px',
...theme.mixins.toolbar,
},
chip: {
margin: theme.spacing.unit,
},
......@@ -115,7 +120,7 @@ class Dashboard extends React.Component {
<div className={classNames(classes.toolbarIcon)}>
<div className={(!this.state.open) && classes.hideIt}>
<Chip
avatar={<Avatar> <ScoolIcon /> </Avatar>}
avatar={<Avatar> <SchoolIcon /> </Avatar>}
label="Outgoing REX"
className={classes.chip}
color="primary"
......@@ -140,10 +145,18 @@ class Dashboard extends React.Component {
</Drawer>
<main className={classes.content}>
<Paper className={classes.myPaper}>
<Typography variant="display1" gutterBottom>
Exploration Cartographique
</Typography>
<Grid container spacing={24}>
<Grid item xs={11}>
<Typography variant="display1" gutterBottom>
Exploration Cartographique
</Typography>
</Grid>
<Grid item xs={1}>
<UnivMapReloadButton/>
</Grid>
</Grid>
<UnivMap />
......
......@@ -86,7 +86,6 @@ class UnivMap extends Component {
const mapStateToProps = (state) => {
console.log("ici", state)
return {
universities: state.universitiesFetched.universities,
fetchedAt: state.universitiesFetched.fetchedAt,
......
import React, { Component } from 'react';
import { connect } from "react-redux";
import CachedIcon from '@material-ui/icons/Cached';
import IconButton from '@material-ui/core/IconButton';
import { withStyles } from '@material-ui/core/styles';
import {
universitiesInvalidated
} from '../actions/universities';
const styles = theme => ({
floatRight: {
float: 'right'
}
});
class UnivMapReloadButton extends Component {
render() {
const { classes } = this.props;
return (
<IconButton
onClick={() => { this.props.invalidate() }}
className={classes.floatRight}
>
<CachedIcon />
</IconButton>
);
}
}
const mapStateToProps = (state) => {
console.log("ici", state)
return {
invalidated: state.universitiesInvalidated
};
};
const mapDispatchToProps = (dispatch) => {
return {
invalidate: () => dispatch(universitiesInvalidated(true))
};
};
export default withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(UnivMapReloadButton));
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