Skip to content

Commit

Permalink
fix(app): add grey square with x for stale and error protocol map
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Apr 25, 2024
1 parent 4ea08cb commit 28b6fb2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 12 deletions.
36 changes: 26 additions & 10 deletions app/src/organisms/ChooseProtocolSlideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,35 @@ function StoredProtocolList(props: StoredProtocolListProps): JSX.Element {
onClick={() => handleSelectProtocol(storedProtocol)}
>
<Box display="grid" gridTemplateColumns="1fr 3fr">
<Box
marginY={SPACING.spacingAuto}
backgroundColor={isSelected ? COLORS.white : 'inherit'}
marginRight={SPACING.spacing16}
height="4.25rem"
width="4.75rem"
>
{!missingAnalysisData ? (
{!missingAnalysisData ? (
<Box
marginY={SPACING.spacingAuto}
backgroundColor={isSelected ? COLORS.white : 'inherit'}
marginRight={SPACING.spacing16}
height="4.25rem"
width="4.75rem"
>
<ProtocolDeck
protocolAnalysis={storedProtocol.mostRecentAnalysis}
/>
) : null}
</Box>
</Box>
) : (
<Flex
height="4.25rem"
width="4.75rem"
marginRight={SPACING.spacing16}
backgroundColor={COLORS.grey30}
borderRadius={SPACING.spacing8}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
>
<Icon
name="ot-close"
color={COLORS.grey40}
size="2.25rem"
/>
</Flex>
)}
<StyledText
as="p"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
Expand Down
26 changes: 24 additions & 2 deletions app/src/organisms/ProtocolsLanding/ProtocolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import {
import type { StoredProtocolData } from '../../redux/protocol-storage'
import type { State } from '../../redux/types'
import { getProtocolUsesGripper } from '../ProtocolSetupInstruments/utils'
import { ALIGN_CENTER } from '@opentrons/components'

Check failure on line 55 in app/src/organisms/ProtocolsLanding/ProtocolCard.tsx

View workflow job for this annotation

GitHub Actions / js checks

'/home/runner/work/opentrons/opentrons/node_modules/@opentrons/components/src/index.ts' imported multiple times

Check failure on line 55 in app/src/organisms/ProtocolsLanding/ProtocolCard.tsx

View workflow job for this annotation

GitHub Actions / js checks

'/home/runner/work/opentrons/opentrons/node_modules/@opentrons/components/src/index.ts' imported multiple times
import { JUSTIFY_CENTER } from '@opentrons/components'

Check failure on line 56 in app/src/organisms/ProtocolsLanding/ProtocolCard.tsx

View workflow job for this annotation

GitHub Actions / js checks

'/home/runner/work/opentrons/opentrons/node_modules/@opentrons/components/src/index.ts' imported multiple times

Check failure on line 56 in app/src/organisms/ProtocolsLanding/ProtocolCard.tsx

View workflow job for this annotation

GitHub Actions / js checks

'/home/runner/work/opentrons/opentrons/node_modules/@opentrons/components/src/index.ts' imported multiple times

interface ProtocolCardProps {
handleRunProtocol: (storedProtocolData: StoredProtocolData) => void
Expand Down Expand Up @@ -184,8 +186,28 @@ function AnalysisInfo(props: AnalysisInfoProps): JSX.Element {
size={SIZE_3}
/>
),
error: <Box size="6rem" backgroundColor={COLORS.grey30} />,
stale: <Box size="6rem" backgroundColor={COLORS.grey30} />,
error: (
<Flex
size="6rem"
backgroundColor={COLORS.grey30}
borderRadius={SPACING.spacing8}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
>
<Icon name="ot-close" color={COLORS.grey40} size="2.75rem" />
</Flex>
),
stale: (
<Flex
size="6rem"
backgroundColor={COLORS.grey30}
borderRadius={SPACING.spacing8}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
>
<Icon name="ot-close" color={COLORS.grey40} size="2.75rem" />
</Flex>
),
complete:
mostRecentAnalysis != null ? (
<ProtocolDeck protocolAnalysis={mostRecentAnalysis} />
Expand Down

0 comments on commit 28b6fb2

Please sign in to comment.