diff --git a/new-lamassu-admin/src/components/buttons/FeatureButton.js b/new-lamassu-admin/src/components/buttons/FeatureButton.js index 86a06c5e..3fe97cd7 100644 --- a/new-lamassu-admin/src/components/buttons/FeatureButton.js +++ b/new-lamassu-admin/src/components/buttons/FeatureButton.js @@ -32,8 +32,8 @@ const styles = { const useStyles = makeStyles(styles) const FeatureButton = memo( - ({ className, Icon, InverseIcon, children, active, ...props }) => { - const classes = useStyles({ active }) + ({ className, Icon, InverseIcon, children, ...props }) => { + const classes = useStyles() const classNames = { [classes.featureButton]: true, diff --git a/new-lamassu-admin/src/pages/Customers/components/EditableCard.js b/new-lamassu-admin/src/pages/Customers/components/EditableCard.js index e3a7f230..fc75f458 100644 --- a/new-lamassu-admin/src/pages/Customers/components/EditableCard.js +++ b/new-lamassu-admin/src/pages/Customers/components/EditableCard.js @@ -123,8 +123,7 @@ const EditableCard = ({ [classes.label1Rejected]: state === OVERRIDE_REJECTED, [classes.label1Accepted]: state === OVERRIDE_AUTHORIZED } - const isNotAuthorized = - state === OVERRIDE_REJECTED || state === OVERRIDE_PENDING + const authorized = state === OVERRIDE_PENDING ? { label: 'Pending', type: 'neutral' } @@ -208,20 +207,28 @@ const EditableCard = ({ Cancel - authorize() : () => reject() - }> - {isNotAuthorized ? 'Authorize' : 'Reject'} - + {authorized.label !== 'Accepted' && ( +
+ authorize()}> + {'Authorize'} + +
+ )} + {authorized.label !== 'Rejected' && ( + reject()}> + {'Reject'} + + )} {error && ( Failed to save changes )}