Skip to content

Commit

Permalink
fix(components, protocol-designer): fix toolbox and transfer tools st…
Browse files Browse the repository at this point in the history
…yling

Add title padding prop to toolbox and set default. Fix shared DropdownMenu component spacing between
title and dropdown

Closes RQA-3414
  • Loading branch information
ncdiehl11 committed Nov 18, 2024
1 parent 8744089 commit ed5a290
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 2 additions & 6 deletions components/src/molecules/DropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,11 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
<Flex
flexDirection={DIRECTION_COLUMN}
ref={dropDownMenuWrapperRef}
gridGap={SPACING.spacing4}
gridGap={SPACING.spacing8}
width={width}
>
{title !== null ? (
<Flex
gridGap={SPACING.spacing8}
paddingBottom={SPACING.spacing8}
alignItems={ALIGN_CENTER}
>
<Flex gridGap={SPACING.spacing8} alignItems={ALIGN_CENTER}>
<StyledText
desktopStyle="bodyDefaultRegular"
color={disabled ? COLORS.grey35 : COLORS.grey60}
Expand Down
4 changes: 3 additions & 1 deletion components/src/organisms/Toolbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface ToolboxProps {
closeButton?: JSX.Element
side?: 'left' | 'right'
horizontalSide?: 'top' | 'bottom'
titlePadding?: string
childrenPadding?: string
subHeader?: JSX.Element | null
secondaryHeaderButton?: JSX.Element
Expand All @@ -45,6 +46,7 @@ export function Toolbox(props: ToolboxProps): JSX.Element {
side = 'right',
horizontalSide = 'bottom',
confirmButton,
titlePadding = SPACING.spacing16,
childrenPadding = SPACING.spacing16,
subHeader,
secondaryHeaderButton,
Expand Down Expand Up @@ -97,7 +99,7 @@ export function Toolbox(props: ToolboxProps): JSX.Element {
justifyContent={JUSTIFY_SPACE_BETWEEN}
>
<Flex
padding={`${SPACING.spacing20} ${SPACING.spacing16}`}
padding={titlePadding}
flexDirection={DIRECTION_COLUMN}
borderBottom={`1px solid ${COLORS.grey30}`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Flex,
Icon,
PrimaryButton,
SPACING,
StyledText,
Toolbox,
} from '@opentrons/components'
Expand Down Expand Up @@ -62,7 +61,6 @@ export function SubstepsToolbox(
substeps.substepType === THERMOCYCLER_PROFILE ? (
<Toolbox
width={FLEX_MAX_CONTENT}
childrenPadding="0"
closeButton={<Icon size="2rem" name="close" />}
onCloseClick={handleClose}
confirmButton={
Expand All @@ -81,7 +79,7 @@ export function SubstepsToolbox(
</StyledText>
}
>
<Flex padding={SPACING.spacing12}>
<Flex>
{substeps.substepType === THERMOCYCLER_PROFILE ? (
<ThermocyclerProfileSubsteps key="substeps" stepId={stepId} />
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export const TimelineToolbox = (): JSX.Element => {
{t('protocol_timeline')}
</StyledText>
}
titlePadding={SPACING.spacing12}
childrenPadding={SPACING.spacing12}
confirmButton={formData != null ? undefined : <AddStepButton />}
>
<Flex
Expand Down

0 comments on commit ed5a290

Please sign in to comment.