Skip to content

Commit

Permalink
refactor highlight logic lower down in components
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed Nov 15, 2024
1 parent 4439375 commit 8da047a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions components/src/hardware-sim/Labware/LabwareRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export interface LabwareRenderProps {
onLabwareClick?: () => void
showBorder?: boolean
strokeColor?: string
canHighlightLabels?: boolean
}

export const LabwareRender = (props: LabwareRenderProps): JSX.Element => {
Expand Down Expand Up @@ -167,7 +166,6 @@ export const LabwareRender = (props: LabwareRenderProps): JSX.Element => {
wellLabelOption={props.wellLabelOption}
wellLabelColor={props.wellLabelColor}
highlightedWellLabels={props.highlightedWellLabels}
canHighlightLabels={props.canHighlightLabels}
/>
) : null}
</g>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export interface WellLabelsProps {
wellLabelOption: WellLabelOption
highlightedWellLabels?: HighlightedWellLabels
wellLabelColor?: string
canHighlightLabels?: boolean
}

const Labels = (props: {
Expand All @@ -29,14 +28,8 @@ const Labels = (props: {
isLetterColumn?: boolean
highlightedWellLabels?: HighlightedWellLabels
wellLabelColor?: string
canHighlightLabels?: boolean
}): JSX.Element => {
const {
wellLabelOption,
highlightedWellLabels,
wellLabelColor,
canHighlightLabels,
} = props
const { wellLabelOption, highlightedWellLabels, wellLabelColor } = props
const highlightColor = highlightedWellLabels?.color ?? C_BLUE
const fillColor = wellLabelColor ?? C_BLACK
const LETTER_COLUMN_X =
Expand Down Expand Up @@ -80,7 +73,7 @@ const Labels = (props: {
? highlightColor
: fillColor
}
canHighlight={canHighlightLabels}
canHighlight={false}
>
{(props.isLetterColumn === true ? /[A-Z]+/g : /\d+/g).exec(
wellName
Expand All @@ -98,7 +91,6 @@ export function WellLabelsComponent(props: WellLabelsProps): JSX.Element {
wellLabelOption,
highlightedWellLabels,
wellLabelColor,
canHighlightLabels,
} = props
const letterColumn = definition.ordering[0] ?? []
const numberRow = definition.ordering.map(wellCol => wellCol[0])
Expand All @@ -112,15 +104,13 @@ export function WellLabelsComponent(props: WellLabelsProps): JSX.Element {
highlightedWellLabels={highlightedWellLabels}
wellLabelColor={wellLabelColor}
isLetterColumn
canHighlightLabels={canHighlightLabels}
/>
<Labels
definition={definition}
wells={numberRow}
wellLabelOption={wellLabelOption}
highlightedWellLabels={highlightedWellLabels}
wellLabelColor={wellLabelColor}
canHighlightLabels={canHighlightLabels}
/>
</g>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ export const SelectableLabware = (props: Props): JSX.Element => {
)(event)
}
}}
canHighlightLabels={false}
/>
)}
</WellTooltip>
Expand Down

0 comments on commit 8da047a

Please sign in to comment.