Skip to content

Commit

Permalink
fix(protocol-designer): fix OffDeckDetails container
Browse files Browse the repository at this point in the history
Refactors padding logic in PD OffDeckDetails outer container to align right with padding, rather than dynamically calculating left padding based on the presence of the details element.

Closes RQA-3953
  • Loading branch information
ncdiehl11 committed Feb 10, 2025
1 parent 8b833e7 commit 673a6cf
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions protocol-designer/src/pages/Designer/OffDeck/OffDeckDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EmptySelectorButton,
Flex,
JUSTIFY_CENTER,
JUSTIFY_FLEX_END,
LabwareRender,
OVERFLOW_AUTO,
RobotWorkSpace,
Expand Down Expand Up @@ -59,27 +60,19 @@ export function OffDeckDetails(props: OffDeckDetailsProps): JSX.Element {
)
const containerWidth = tab === 'startingDeck' ? '100vw' : '75vw'

const paddingLeftWithHover =
hoverSlot == null
? `calc((${containerWidth} - (${SPACING.spacing24} * 2) - ${OFF_DECK_MAP_WIDTH}) / 2)`
: SPACING.spacing24
const paddingLeft = tab === 'startingDeck' ? paddingLeftWithHover : undefined
const padding =
tab === 'protocolSteps'
? SPACING.spacing24
: `${SPACING.spacing40} ${paddingLeft}`
const stepDetailsContainerWidth = `calc(((${containerWidth} - ${OFF_DECK_MAP_WIDTH}) / 2) - (${SPACING.spacing24} * 3))`
const paddingRight = `calc((100% - ${OFF_DECK_MAP_WIDTH}) / 2)`

return (
<Flex
backgroundColor={COLORS.white}
borderRadius={BORDERS.borderRadius12}
width="100%"
height="100%"
padding={padding}
padding={`${SPACING.spacing24} ${paddingRight} ${SPACING.spacing24} 0`}
gridGap={SPACING.spacing24}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
justifyContent={JUSTIFY_FLEX_END}
>
{hoverSlot != null ? (
<Flex width={stepDetailsContainerWidth} height="6.25rem">
Expand Down

0 comments on commit 673a6cf

Please sign in to comment.