completed code quality check, code reusability

This commit is contained in:
Amruth Pillai
2020-03-29 23:34:14 +05:30
parent 9510d44949
commit 07696b40ee
2 changed files with 5 additions and 17 deletions

View File

@ -7,7 +7,7 @@ import TextField from '../../../shared/TextField';
import TextArea from '../../../shared/TextArea';
import AppContext from '../../../context/AppContext';
import Checkbox from '../../../shared/Checkbox';
import { addItem, deleteItem, moveItemUp, moveItemDown } from '../../../utils';
import { addItem } from '../../../utils';
import ItemActions from '../../../shared/ItemActions';
import AddItemButton from '../../../shared/AddItemButton';
@ -171,14 +171,11 @@ const Item = ({ item, index, onChange, dispatch, first, last }) => {
<Form item={item} onChange={onChange} identifier={identifier} />
<ItemActions
deleteItem={deleteItem}
dispatch={dispatch}
first={first}
identifier={identifier}
item={item}
last={last}
moveItemDown={moveItemDown}
moveItemUp={moveItemUp}
onChange={onChange}
type="work"
/>

View File

@ -1,18 +1,9 @@
import React from 'react';
import Checkbox from './Checkbox';
const ItemActions = ({
deleteItem,
dispatch,
first,
identifier,
item,
last,
moveItemDown,
moveItemUp,
onChange,
type,
}) => {
import Checkbox from './Checkbox';
import { deleteItem, moveItemUp, moveItemDown } from '../utils';
const ItemActions = ({ dispatch, first, identifier, item, last, onChange, type }) => {
return (
<div className="flex justify-between">
<div className="flex items-center">