Commit 3c9ab3b0 authored by Florent Chehab's avatar Florent Chehab

Generic group module added

parent a4804b04
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Paper from '@material-ui/core/Paper';
import Tooltip from '@material-ui/core/Tooltip';
import Button from '@material-ui/core/Button';
import Grid from '@material-ui/core/Grid';
import Divider from '@material-ui/core/Divider';
import AddIcon from '@material-ui/icons/Add';
import green from '@material-ui/core/colors/green';
const styles = theme => ({
root: {
paddingTop: 3 * theme.spacing.unit,
paddingBottom: 3 * theme.spacing.unit,
paddingRight: 5 * theme.spacing.unit,
paddingLeft: 5 * theme.spacing.unit,
flexGrow: 1,
},
green: {
color: green.A200,
},
button: {
width: 5 * theme.spacing.unit,
height: 5 * theme.spacing.unit,
boxShadow: 'none',
marginBottom: theme.spacing.unit,
},
});
class GenericGroupModule extends React.Component {
render() {
const { classes, theme, groupTitle } = this.props;
return (
<Paper className={classes.root}>
<Grid container spacing={8} alignItems='center'>
<Grid item xs>
<Typography variant='title' align='center' color="textSecondary"><em>{groupTitle}</em></Typography>
</Grid>
<Grid item xs={2} style={{ textAlign: 'right' }}>
<Tooltip title="Ajouter un élément" placement="top">
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip when below is disabled! */}
<Button variant='fab' mini aria-label="Ajouter un élément" disabled={false} style={{ backgroundColor: green.A700 }} className={classes.button}>
<AddIcon />
</Button>
</div>
</Tooltip>
</Grid>
</Grid>
<Divider />
{this.props.children}
</Paper>
)
}
}
GenericGroupModule.propTypes = {
groupTitle: PropTypes.string.isRequired,
};
export default withStyles(styles, { withTheme: true })(GenericGroupModule);
......@@ -138,7 +138,7 @@ function renderFirstRow() {
<Grid item xs={4} style={{ textAlign: 'right' }}>
<Tooltip title="Informations sur la modération" placement="top">
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip! */}
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip when below is disabled! when below is disabled!! */}
<MyBadge classes={{ badge: classes.badge }} badgeContent={null} color="secondary">
<IconButton aria-label="Modération" disabled={automaticData} className={classes.button}>
<VerifiedUserIcon className={classes[classModer]} />
......@@ -148,7 +148,7 @@ function renderFirstRow() {
</Tooltip>
<Tooltip title="Informations sur les possibilités d'éditions" placement="top">
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip! */}
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip when below is disabled!! */}
<IconButton aria-label="Éditer" className={classes.button} disabled={automaticData} onClick={this.handleClickOpenFullScreenDialog}>
<CreateIcon className={classes[classEdit]} />
</IconButton>
......@@ -156,7 +156,7 @@ function renderFirstRow() {
</Tooltip>
<Tooltip title="Informations sur les versions disponibles" placement="top">
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip! */}
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip when below is disabled!! */}
<MyBadge classes={{ badge: classes.badge }} badgeContent={40} color="secondary">
<IconButton aria-label="Restorer" disabled={automaticData} className={classes.button}>
<SettingsBackRestoreIcon className={classes[classVersion]} />
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Paper from '@material-ui/core/Paper';
import Tooltip from '@material-ui/core/Tooltip';
import Button from '@material-ui/core/Button';
import MyComponent from '../../MyComponent';
import TextLink from '../../other/TextLink';
import GenericModule from './GenericModule';
import Grid from '@material-ui/core/Grid';
import Divider from '@material-ui/core/Divider';
import AddIcon from '@material-ui/icons/Add';
import green from '@material-ui/core/colors/green';
import GenericGroupModule from './GenericGroupModule';
const styles = theme => ({
root: {
padding: 3 * theme.spacing.unit,
flexGrow: 1,
},
green: {
color: green.A200,
},
button: {
width: 5 * theme.spacing.unit,
height: 5 * theme.spacing.unit,
boxShadow: 'none',
marginBottom: theme.spacing.unit,
},
});
......@@ -41,28 +18,9 @@ class UniversityDri extends React.Component {
render() {
const { classes, theme } = this.props;
return (
<Paper className={classes.root}>
<Grid container spacing={8} alignItems='center'>
<Grid item xs>
<Typography variant='title' align='center' color="textSecondary"><em>Informations émanant de la DRI</em></Typography>
</Grid>
<Grid item xs={2} style={{ textAlign: 'right' }}>
<Tooltip title="Ajouter un élément" placement="top">
<div style={{ display: 'inline-block' }}> {/* Needed to fire events for the tooltip! */}
<Button variant='fab' mini aria-label="Ajouter un élément DRI" disabled={false} style={{ backgroundColor: green.A700 }} className={classes.button}>
<AddIcon />
</Button>
</div>
</Tooltip>
</Grid>
</Grid>
<Divider />
<GenericModule title={"DRI"} importanceLevel={'IMPORTANT'}/>
</Paper>
<GenericGroupModule groupTitle={"Informations émanant de la DRI"}>
<GenericModule title={"DRI"} importanceLevel={'IMPORTANT'} />
</GenericGroupModule >
)
}
}
......
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