Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Mar 14, 2024
1 parent 0f87da2 commit e152095
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
32 changes: 13 additions & 19 deletions app/src/organisms/FirmwareUpdateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import {
Icon,
RESPONSIVENESS,
JUSTIFY_CENTER,
BORDERS,
COLORS,
} from '@opentrons/components'
import {
useInstrumentsQuery,
useSubsystemUpdateQuery,
useUpdateSubsystemMutation,
} from '@opentrons/react-api-client'
import { ProgressBar } from '../../atoms/ProgressBar'
import { StyledText } from '../../atoms/text'
import { BadGripper, BadPipette, Subsystem } from '@opentrons/api-client'

Expand Down Expand Up @@ -55,11 +53,6 @@ const MODAL_STYLE = css`
height: 31.5625rem;
}
`
const OUTER_STYLES = css`
border-radius: ${BORDERS.borderRadiusSize4};
background: ${COLORS.grey30};
width: 13.374rem;
`

const SPINNER_STYLE = css`
color: ${COLORS.grey50};
Expand All @@ -81,7 +74,7 @@ export const FirmwareUpdateModal = (
isOnDevice,
} = props
const [updateId, setUpdateId] = React.useState<string | null>(null)
const [firmwareText, setFirmwareText] = React.useState('')
const [firmwareText, setFirmwareText] = React.useState<string | null>(null)
const {
data: attachedInstruments,
refetch: refetchInstruments,
Expand Down Expand Up @@ -113,7 +106,6 @@ export const FirmwareUpdateModal = (
}, [])
const { data: updateData } = useSubsystemUpdateQuery(updateId)
const status = updateData?.data.updateStatus
const percentComplete = updateData?.data.updateProgress ?? 0

React.useEffect(() => {
if ((status != null || updateNeeded) && firmwareText !== description) {
Expand All @@ -140,24 +132,26 @@ export const FirmwareUpdateModal = (

return (
<Flex css={MODAL_STYLE}>
<StyledText css={DESCRIPTION_STYLE}>
{firmwareText.length ? firmwareText : 'Checking for updates...'}
</StyledText>
{status != null || updateNeeded ? (
<ProgressBar
percentComplete={percentComplete}
outerStyles={OUTER_STYLES}
/>
) : null}
{firmwareText.length ? null : (
{status != null || updateNeeded || !firmwareText ? (
<Icon
name="ot-spinner"
aria-label="spinner"
size={isOnDevice ? '6.25rem' : '5.125rem'}
marginBottom={SPACING.spacing12}
css={SPINNER_STYLE}
spin
/>
) : (
<Icon
name="ot-check"
size={isOnDevice ? '6.25rem' : '5.125rem'}
marginBottom={SPACING.spacing12}
color={COLORS.green60}
/>
)}
<StyledText css={DESCRIPTION_STYLE}>
{firmwareText ?? 'Checking for updates...'}
</StyledText>
</Flex>
)
}
1 change: 1 addition & 0 deletions mock_dir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit e152095

Please sign in to comment.