From 6fea8998a095f456b3aaf4dd8c153eaad0257d2c Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sat, 25 Aug 2018 19:01:36 +0300 Subject: [PATCH] remove selector animation --- react/src/components/lists/Lists.js | 2 +- react/src/components/lists/Selector.js | 114 +++++++----------- .../{todolist => lists}/SelectorContainer.js | 2 +- 3 files changed, 46 insertions(+), 72 deletions(-) rename react/src/components/{todolist => lists}/SelectorContainer.js (93%) diff --git a/react/src/components/lists/Lists.js b/react/src/components/lists/Lists.js index 19649a4..1d545bb 100644 --- a/react/src/components/lists/Lists.js +++ b/react/src/components/lists/Lists.js @@ -3,7 +3,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import ListActionsContainer from './ListActionsContainer'; -import SelectorContainer from '../todolist/SelectorContainer'; +import SelectorContainer from './SelectorContainer'; function Lists({ userLoaded, listsLoaded }) { return ( diff --git a/react/src/components/lists/Selector.js b/react/src/components/lists/Selector.js index 3d725a4..a609591 100644 --- a/react/src/components/lists/Selector.js +++ b/react/src/components/lists/Selector.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { Select, MenuItem } from '@material-ui/core'; import AddIcon from '@material-ui/icons/Add'; import CheckIcon from '@material-ui/icons/Check'; -import { Transition, animated } from 'react-spring'; +import { animated } from 'react-spring'; import './Selector.css'; @@ -28,83 +28,57 @@ export default function Selector({ if (creating) { let input = null; return ( - - {styles => ( - - { - input = node; - }} - id="input" - type="text" - onKeyPress={e => { - if (e.key === 'Enter') { - addList(input.value); - } - }} - /> - input.value.trim() && addList(input.value)} - > - - - - )} - +
+ { + input = node; + }} + id="input" + type="text" + onKeyPress={e => { + if (e.key === 'Enter') { + addList(input.value); + } + }} + /> + input.value.trim() && addList(input.value)} + > + + +
); } if (editing) { let input = null; return ( - - {styles => ( - - { - input = node; - }} - defaultValue={lists.lists[list].name} - id="input" - type="text" - onKeyPress={e => { - if (e.key === 'Enter') { - editList(input.value); - } - }} - /> - input.value.trim() && editList(input.value)} - > - - - - )} - +
+ { + input = node; + }} + defaultValue={lists.lists[list].name} + id="input" + type="text" + onKeyPress={e => { + if (e.key === 'Enter') { + editList(input.value); + } + }} + /> + input.value.trim() && editList(input.value)} + > + + +
); } if (list) { return ( - +
- +
); } return null; diff --git a/react/src/components/todolist/SelectorContainer.js b/react/src/components/lists/SelectorContainer.js similarity index 93% rename from react/src/components/todolist/SelectorContainer.js rename to react/src/components/lists/SelectorContainer.js index 7335350..4468b43 100644 --- a/react/src/components/todolist/SelectorContainer.js +++ b/react/src/components/lists/SelectorContainer.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import Selector from '../lists/Selector'; +import Selector from './Selector'; import { changeList, addList, editList } from '../../actions/lists'; function mapStateToProps(state) {