Tasks: reorganizes Tasks components into their own subfolder

master
Andrew P Maney 5 years ago committed by Tom Hacohen
parent 680f9698a7
commit 5d54ab4563

@ -14,8 +14,8 @@ import SearchableAddressBook from '../components/SearchableAddressBook';
import Contact from '../components/Contact'; import Contact from '../components/Contact';
import Calendar from '../components/Calendar'; import Calendar from '../components/Calendar';
import Event from '../components/Event'; import Event from '../components/Event';
import Task from '../components/Task'; import Task from '../components/Tasks/Task';
import TaskList from '../components/TaskList'; import TaskList from '../components/Tasks/TaskList';
import AppBarOverride from '../widgets/AppBarOverride'; import AppBarOverride from '../widgets/AppBarOverride';
import Container from '../widgets/Container'; import Container from '../widgets/Container';

@ -16,7 +16,7 @@ import Container from '../widgets/Container';
import SearchableAddressBook from '../components/SearchableAddressBook'; import SearchableAddressBook from '../components/SearchableAddressBook';
import Calendar from '../components/Calendar'; import Calendar from '../components/Calendar';
import TaskList from '../components/TaskList'; import TaskList from '../components/Tasks/TaskList';
import { EventType, ContactType, TaskType } from '../pim-types'; import { EventType, ContactType, TaskType } from '../pim-types';

@ -27,8 +27,8 @@ import ContactEdit from '../components/ContactEdit';
import Contact from '../components/Contact'; import Contact from '../components/Contact';
import EventEdit from '../components/EventEdit'; import EventEdit from '../components/EventEdit';
import Event from '../components/Event'; import Event from '../components/Event';
import TaskEdit from '../components/TaskEdit'; import TaskEdit from '../components/Tasks/TaskEdit';
import Task from '../components/Task'; import Task from '../components/Tasks/Task';
import PimMain from './PimMain'; import PimMain from './PimMain';
import { routeResolver } from '../App'; import { routeResolver } from '../App';

@ -3,11 +3,11 @@
import * as React from 'react'; import * as React from 'react';
import PimItemHeader from './PimItemHeader'; import PimItemHeader from '../PimItemHeader';
import { formatDate, formatOurTimezoneOffset } from '../helpers'; import { formatDate, formatOurTimezoneOffset } from '../../helpers';
import { TaskType } from '../pim-types'; import { TaskType } from '../../pim-types';
class Task extends React.PureComponent { class Task extends React.PureComponent {
public props: { public props: {

@ -20,10 +20,10 @@ import IconDelete from '@material-ui/icons/Delete';
import IconCancel from '@material-ui/icons/Clear'; import IconCancel from '@material-ui/icons/Clear';
import IconSave from '@material-ui/icons/Save'; import IconSave from '@material-ui/icons/Save';
import DateTimePicker from '../widgets/DateTimePicker'; import DateTimePicker from '../../widgets/DateTimePicker';
import ConfirmationDialog from '../widgets/ConfirmationDialog'; import ConfirmationDialog from '../../widgets/ConfirmationDialog';
import TimezonePicker from '../widgets/TimezonePicker'; import TimezonePicker from '../../widgets/TimezonePicker';
import { Location } from 'history'; import { Location } from 'history';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
@ -33,9 +33,9 @@ import * as ICAL from 'ical.js';
import * as EteSync from 'etesync'; import * as EteSync from 'etesync';
import { getCurrentTimezone } from '../helpers'; import { getCurrentTimezone } from '../../helpers';
import { TaskType, TaskStatusType, timezoneLoadFromName } from '../pim-types'; import { TaskType, TaskStatusType, timezoneLoadFromName } from '../../pim-types';
interface PropsType { interface PropsType {
collections: EteSync.CollectionInfo[]; collections: EteSync.CollectionInfo[];

@ -5,27 +5,14 @@ import * as React from 'react';
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import { List, ListItem } from '../widgets/List'; import { List } from '../../widgets/List';
import { TaskType } from '../pim-types'; import { TaskType } from '../../pim-types';
import FormControlLabel from '@material-ui/core/FormControlLabel'; import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox'; import Checkbox from '@material-ui/core/Checkbox';
import Divider from '@material-ui/core/Divider'; import Divider from '@material-ui/core/Divider';
const TaskListItem = React.memo((props: { entry: TaskType, onClick: (entry: TaskType) => void }) => { import TaskListItem from './TaskListItem';
const {
entry,
onClick,
} = props;
const title = entry.title;
return (
<ListItem
primaryText={title}
onClick={() => onClick(entry)}
/>
);
});
const sortSelector = createSelector( const sortSelector = createSelector(
(entries: TaskType[]) => entries, (entries: TaskType[]) => entries,

@ -0,0 +1,21 @@
import * as React from 'react';
import { TaskType } from '../../pim-types';
import { ListItem } from '../../widgets/List';
const TaskListItem = React.memo((props: { entry: TaskType, onClick: (entry: TaskType) => void }) => {
const {
entry,
onClick,
} = props;
const title = entry.title;
return (
<ListItem
primaryText={title}
onClick={() => onClick(entry)}
/>
);
});
export default TaskListItem;
Loading…
Cancel
Save