Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Nov 7, 2023
1 parent a87af5f commit a4b22fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 3 additions & 4 deletions app/src/molecules/DeckThumbnail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import map from 'lodash/map'

import { BaseDeck, SlotLabels } from '@opentrons/components'
import { BaseDeck } from '@opentrons/components'
import {
getDeckDefFromRobotType,
getRobotTypeFromLoadedLabware,
Expand Down Expand Up @@ -121,9 +121,8 @@ export function DeckThumbnail(props: DeckThumbnailProps): JSX.Element | null {
robotType={robotType}
labwareLocations={labwareLocations}
moduleLocations={moduleLocations}
showSlotLabels={showSlotLabels}
{...styleProps}
>
{showSlotLabels ? <SlotLabels robotType={robotType} /> : null}
</BaseDeck>
></BaseDeck>
)
}
10 changes: 6 additions & 4 deletions components/src/hardware-sim/BaseDeck/BaseDeck.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react'
import isEmpty from 'lodash/isEmpty'

import {
RobotType,
Expand Down Expand Up @@ -65,6 +64,7 @@ interface BaseDeckProps {
lightFill?: string
darkFill?: string
children?: React.ReactNode
showSlotLabels?: boolean
}

export function BaseDeck(props: BaseDeckProps): JSX.Element {
Expand All @@ -80,6 +80,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
deckConfig = STANDARD_SLOT_DECK_CONFIG_FIXTURE,
showExpansion = true,
children,
showSlotLabels = false,
} = props
const deckDef = getDeckDefFromRobotType(robotType)

Expand Down Expand Up @@ -204,12 +205,11 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
'slotName' in labwareLocation &&
s.id === labwareLocation.slotName
)
const labwareHasLiquid = !isEmpty(wellFill)
return slotDef != null ? (
<g
key={slotDef.id}
transform={`translate(${slotDef.position[0]},${slotDef.position[1]})`}
cursor={labwareHasLiquid ? 'pointer' : ''}
cursor={onLabwareClick != null ? 'pointer' : ''}
>
<LabwareRender
definition={definition}
Expand All @@ -221,7 +221,9 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
) : null
}
)}
<SlotLabels robotType={robotType} color={darkFill} />
{showSlotLabels ? (
<SlotLabels robotType={robotType} color={darkFill} />
) : null}
{children}
</RobotCoordinateSpace>
)
Expand Down

0 comments on commit a4b22fc

Please sign in to comment.