Skip to content

Commit

Permalink
do not use isOnDevice for icon rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Jul 18, 2024
1 parent b3df530 commit 5cdcaad
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions app/src/molecules/InterventionModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import { useSelector } from 'react-redux'
import {css} from 'styled-components'

import {
ALIGN_CENTER,
Expand All @@ -15,6 +16,7 @@ import {
POSITION_STICKY,
SPACING,
DIRECTION_COLUMN,
RESPONSIVENESS
} from '@opentrons/components'

import { getIsOnDevice } from '../../redux/config'
Expand Down Expand Up @@ -166,15 +168,7 @@ export function InterventionModal({
onClick={iconHeadingOnClick}
>
{iconName != null ? (
isOnDevice ? (
<Icon name={iconName} size={SPACING.spacing32} />
) : (
<Icon
width={SPACING.spacing16}
height={SPACING.spacing16}
name={iconName}
/>
)
<Icon name={iconName} css={ICON_SIZE} />
) : null}
{iconHeading ?? null}
</Flex>
Expand All @@ -185,3 +179,13 @@ export function InterventionModal({
</Flex>
)
}


const ICON_SIZE = css`
width: 1rem;
height: 1rem;
@media (${RESPONSIVENESS.touchscreenMediaQuerySpecs}) {
width: 2rem;
height: 2rem;
}
`

0 comments on commit 5cdcaad

Please sign in to comment.