Skip to content

Commit

Permalink
fix(app): fix font size in parameters screen odd (#14693)
Browse files Browse the repository at this point in the history
* fix(app): fix font size in parameters screen odd
  • Loading branch information
koji authored Mar 19, 2024
1 parent 3e7ba7f commit 003582f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/src/organisms/ProtocolSetupParameters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {
Flex,
SPACING,
} from '@opentrons/components'
import { ProtocolSetupStep, SetupScreens } from '../../pages/ProtocolSetup'
import { ProtocolSetupStep } from '../../pages/ProtocolSetup'
import { useMostRecentCompletedAnalysis } from '../LabwarePositionCheck/useMostRecentCompletedAnalysis'
import { ChildNavigation } from '../ChildNavigation'
import { ResetValuesModal } from './ResetValuesModal'

import type { RunTimeParameter } from '@opentrons/shared-data'
import type { SetupScreens } from '../../pages/ProtocolSetup'

const mockData: RunTimeParameter[] = [
{
Expand Down Expand Up @@ -241,6 +242,7 @@ export function ProtocolSetupParameters({
onClickSetupStep={() => console.log('TODO: wire this up')}
detail={getDefault(parameter)}
description={parameter.description}
fontSize="h4"
/>
</React.Fragment>
)
Expand Down
15 changes: 13 additions & 2 deletions app/src/pages/ProtocolSetup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ interface ProtocolSetupStepProps {
description?: string
// optional removal of the icon
hasIcon?: boolean
// optional enlarge the font size
fontSize?: string
}

export function ProtocolSetupStep({
Expand All @@ -128,6 +130,7 @@ export function ProtocolSetupStep({
disabledReason,
description,
hasIcon = true,
fontSize = 'p',
}: ProtocolSetupStepProps): JSX.Element {
const backgroundColorByStepStatus = {
ready: COLORS.green35,
Expand Down Expand Up @@ -162,6 +165,8 @@ export function ProtocolSetupStep({
}
`

const isToggle = detail === 'On' || detail === 'Off'

return (
<Btn
onClick={() =>
Expand Down Expand Up @@ -201,9 +206,15 @@ export function ProtocolSetupStep({
{description}
</StyledText>
</Flex>
<Flex flex="1" justifyContent={JUSTIFY_END}>
<Flex
flex="1"
justifyContent={JUSTIFY_END}
padding={
isToggle ? `${SPACING.spacing12} ${SPACING.spacing10}` : 'undefined'
}
>
<StyledText
as="p"
as={fontSize}
textAlign={TEXT_ALIGN_RIGHT}
color={disabled ? COLORS.grey50 : COLORS.black90}
maxWidth="20rem"
Expand Down

0 comments on commit 003582f

Please sign in to comment.