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