Skip to content

Commit

Permalink
Remove unnecessary import of useState
Browse files Browse the repository at this point in the history
Signed-off-by: Christos Malliaridis <c.malliaridis@gmail.com>
  • Loading branch information
malliaridis committed Jun 17, 2020
1 parent 00b1c75 commit ec5d8f8
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
*/

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { get, map } from 'lodash';
import { FormattedMessage } from 'react-intl';
Expand All @@ -18,22 +17,15 @@ function Controller({ actions, inputNamePath, isOpen, name, inputSelected, setIn
const { selectAllActions } = useEditPageContext();

const areAllActionsSelected = () => {
return Object.keys(actions).every(
action => actions[action].enabled === true
);
return Object.keys(actions).every(action => actions[action].enabled === true);
};

const handleChange = () => {
selectAllActions(
`${inputNamePath}.controllers.${name}`,
!areAllActionsSelected()
);
selectAllActions(`${inputNamePath}.controllers.${name}`, !areAllActionsSelected());
};

const hasSomeActionsSelected = () => {
return Object.keys(actions).some(
action => actions[action].enabled === true
);
return Object.keys(actions).some(action => actions[action].enabled === true);
};

const setNewInputSelected = name => {
Expand Down

0 comments on commit ec5d8f8

Please sign in to comment.