Commit 50b55c85 authored by Florent Chehab's avatar Florent Chehab
Browse files

Cleaned some imports and move field to new file

parent 8654dc22
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import Paper from '@material-ui/core/Paper';
......
......@@ -2,7 +2,7 @@
import React from 'react';
import ReactMarkdown from 'react-markdown';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Typography from '@material-ui/core/Typography';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import withWidth, { isWidthUp } from '@material-ui/core/withWidth';
import { compose } from 'recompose';
import compose from 'recompose/compose';
import AppBar from '@material-ui/core/AppBar';
import Tabs from '@material-ui/core/Tabs';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Typography from '@material-ui/core/Typography';
import Paper from '@material-ui/core/Paper';
import Tooltip from '@material-ui/core/Tooltip';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { compose } from 'recompose';
import { connect } from "react-redux";
import withStyles from '@material-ui/core/styles/withStyles';
import compose from 'recompose/compose';
import {connect} from "react-redux";
import Paper from '@material-ui/core/Paper';
import FullScreenDialog from '../../shared/FullScreenDialog';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import ExpansionPanel from '@material-ui/core/ExpansionPanel';
import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Paper from '@material-ui/core/Paper';
import GenericModule from './GenericModule';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Typography from '@material-ui/core/Typography';
import PhotoIcon from '@material-ui/icons/Photo';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { compose } from 'recompose';
import { connect } from "react-redux";
import withStyles from '@material-ui/core/styles/withStyles';
import compose from 'recompose/compose';
import {connect} from "react-redux";
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { compose } from 'recompose';
import { connect } from "react-redux";
import withStyles from '@material-ui/core/styles/withStyles';
import compose from 'recompose/compose';
import {connect} from "react-redux";
import TextField from '@material-ui/core/TextField';
import MyComponent from '../../../MyComponent';
import MyDatePicker from '../../../shared/MyDatePicker';
import UsefulLinksField from '../../../shared/UsefulLinksField';
import MardownField from '../../../shared/MarkdownField';
import DateField from './fields/DateField';
import UsefulLinksField from './fields/UsefulLinksField';
import MarkdownField from './fields/MarkdownField';
// import dateToStr from '../../../utils/dateToStr';
......@@ -25,11 +25,11 @@ class UniversitySemestersDatesEditor extends MyComponent {
myRender() {
return (
<div>
<MyDatePicker label={"Date de début du semestre de printemps :"} />
<MyDatePicker label={"Date de fin du semestre de printemps :"} />
<MyDatePicker label={"Date de début du semestre d'automne :"} />
<MyDatePicker label={"Date de fin du semestre d'automne :"} />
<MardownField />
<DateField label={"Date de début du semestre de printemps :"} />
<DateField label={"Date de fin du semestre de printemps :"} />
<DateField label={"Date de début du semestre d'automne :"} />
<DateField label={"Date de fin du semestre d'automne :"} />
<MarkdownField />
<UsefulLinksField />
</div>
)
......
......@@ -3,8 +3,8 @@ import DatePicker from 'material-ui-pickers/DatePicker';
import DateFnsUtils from 'material-ui-pickers/utils/date-fns-utils';
import MuiPickersUtilsProvider from 'material-ui-pickers/utils/MuiPickersUtilsProvider';
import PropTypes from 'prop-types';
import { compose } from 'recompose';
import { withStyles } from '@material-ui/core/styles';
import compose from 'recompose/compose';
import withStyles from '@material-ui/core/styles/withStyles';
import frLocale from 'date-fns/locale/fr';
import format from 'date-fns/format';
......@@ -30,7 +30,7 @@ class LocalizedUtils extends DateFnsUtils {
}
}
class MyDatePicker extends PureComponent {
class DateField extends PureComponent {
state = {
selectedDate: this.props.selectedDate,
}
......@@ -65,13 +65,13 @@ class MyDatePicker extends PureComponent {
}
}
MyDatePicker.defaultProps = {
DateField.defaultProps = {
selectedDate: Date.now(),
handleDateChange: (date) => console.log('Nouvelle date sélectionnée : ', date),
label: 'LABEL'
}
MyDatePicker.propTypes = {
DateField.propTypes = {
selectedDate: PropTypes.instanceOf(Date).isRequired,
handleDateChange: PropTypes.func.isRequired,
label: PropTypes.string.isRequired
......@@ -80,4 +80,4 @@ MyDatePicker.propTypes = {
export default compose(
withStyles(styles, { withTheme: true }),
)(MyDatePicker);
)(DateField);
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Grid from '@material-ui/core/Grid';
import { compose } from 'recompose';
import compose from 'recompose/compose';
import TextField from '@material-ui/core/TextField';
import Markdown from './Markdown';
import { Typography } from '@material-ui/core';
import LinkText from '../other/TextLink';
import Typography from '@material-ui/core/Typography';
import Markdown from '../../../../shared/Markdown';
import LinkText from '../../../../other/TextLink';
const styles = theme => ({
})
......
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import Grid from '@material-ui/core/Grid';
import { compose } from 'recompose';
import compose from 'recompose/compose';
import TextField from '@material-ui/core/TextField';
import IconButton from '@material-ui/core/IconButton';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import MyComponent from '../../MyComponent';
import GenericGroupModules from '../modules/GenericGroupModule';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import MyComponent from '../../MyComponent';
import { compose } from 'recompose';
import compose from 'recompose/compose';
import GenericModule from '../modules/GenericModule';
import Grid from '@material-ui/core/Grid';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import MyComponent from '../../MyComponent';
import GenericGroupModules from '../modules/GenericGroupModule';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import MyComponent from '../../MyComponent';
import PreviousDeparture from '../modules/PreviousDeparture';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import MyComponent from '../../MyComponent';
import GenericGroupModules from '../modules/GenericGroupModule';
......
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import withStyles from '@material-ui/core/styles/withStyles';
import MyComponent from '../../MyComponent';
import GenericGroupModules from '../modules/GenericGroupModule';
......
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