diff --git a/app/src/components/InstrumentSettings/ModulesCardContents.js b/app/src/components/InstrumentSettings/ModulesCardContents.js index 8b9490013b85..7427aae6505a 100644 --- a/app/src/components/InstrumentSettings/ModulesCardContents.js +++ b/app/src/components/InstrumentSettings/ModulesCardContents.js @@ -16,8 +16,8 @@ export function ModulesCardContents(props: Props) { return ( <> - {modules.map((mod, index) => ( - + {modules.map(mod => ( + ))} ) diff --git a/app/src/components/ModuleItem/ModuleUpdate.js b/app/src/components/ModuleItem/ModuleUpdate.js index 84b3b8a5a1c7..3b239ab0b248 100644 --- a/app/src/components/ModuleItem/ModuleUpdate.js +++ b/app/src/components/ModuleItem/ModuleUpdate.js @@ -1,7 +1,12 @@ // @flow import * as React from 'react' import { useSelector, useDispatch } from 'react-redux' -import { OutlineButton, HoverTooltip } from '@opentrons/components' +import { + OutlineButton, + HoverTooltip, + SpinnerModalPage, + Icon, +} from '@opentrons/components' import { getConnectedRobotName } from '../../robot/selectors' import { updateModule } from '../../modules/actions' import type { Dispatch } from '../../types' @@ -19,21 +24,31 @@ export function ModuleUpdate(props: Props) { const { hasAvailableUpdate, moduleId } = props const robotName = useSelector(getConnectedRobotName) const dispatch = useDispatch() + const [updateInProgress, setUpdateInProgress] = React.useState(false) const buttonText = hasAvailableUpdate ? 'update' : 'updated' return (
- + {hoverTooltipHandlers => (
+ onClick={() => { + setUpdateInProgress(true) robotName && dispatch(updateModule(robotName, moduleId)) - } + }} disabled={!robotName || !hasAvailableUpdate} > - {buttonText} + {updateInProgress ? ( + + ) : ( + buttonText + )}
)}