Skip to content

Commit 430a81a

Browse files
committed
update StepInfo
1 parent 8752414 commit 430a81a

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

app/src/organisms/ErrorRecoveryFlows/RunPausedSplash.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function RunPausedSplash(
115115
<Flex width="49rem" justifyContent={JUSTIFY_CENTER}>
116116
<StepInfo
117117
{...props}
118-
textStyle="level3HeaderBold"
118+
oddStyle="level3HeaderBold"
119119
overflow="hidden"
120120
overflowWrap={OVERFLOW_WRAP_BREAK_WORD}
121121
color={COLORS.white}
@@ -155,7 +155,6 @@ export function RunPausedSplash(
155155
<Flex
156156
gridGap={SPACING.spacing24}
157157
flexDirection={DIRECTION_COLUMN}
158-
alignItems={ALIGN_FLEX_END}
159158
justifyContent={JUSTIFY_SPACE_BETWEEN}
160159
>
161160
<Flex
@@ -180,7 +179,7 @@ export function RunPausedSplash(
180179
<StyledText desktopStyle="headingSmallBold">{title}</StyledText>
181180
<StepInfo
182181
{...props}
183-
textStyle="bodyDefaultRegular"
182+
desktopStyle="bodyDefaultRegular"
184183
overflow="hidden"
185184
overflowWrap={OVERFLOW_WRAP_BREAK_WORD}
186185
textAlign={TEXT_ALIGN_CENTER}

app/src/organisms/ErrorRecoveryFlows/shared/StepInfo.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ import * as React from 'react'
22

33
import { useTranslation } from 'react-i18next'
44

5-
import { Flex, DISPLAY_INLINE, LegacyStyledText } from '@opentrons/components'
5+
import { Flex, DISPLAY_INLINE, StyledText } from '@opentrons/components'
66

77
import { CommandText } from '../../../molecules/Command'
88

99
import type { StyleProps } from '@opentrons/components'
1010
import type { RecoveryContentProps } from '../types'
1111

1212
interface StepInfoProps extends StyleProps {
13-
textStyle: React.ComponentProps<typeof LegacyStyledText>['as']
1413
stepCounts: RecoveryContentProps['stepCounts']
1514
failedCommand: RecoveryContentProps['failedCommand']
1615
robotType: RecoveryContentProps['robotType']
1716
protocolAnalysis: RecoveryContentProps['protocolAnalysis']
17+
desktopStyle?: React.ComponentProps<typeof StyledText>['desktopStyle']
18+
oddStyle?: React.ComponentProps<typeof StyledText>['oddStyle']
1819
}
1920

2021
export function StepInfo({
21-
textStyle,
22+
desktopStyle,
23+
oddStyle,
2224
stepCounts,
2325
failedCommand,
2426
robotType,
@@ -35,18 +37,27 @@ export function StepInfo({
3537
const currentCopy = currentStepNumber ?? '?'
3638
const totalCopy = totalStepCount ?? '?'
3739

40+
const desktopStyleDefaulted = desktopStyle ?? 'bodyDefaultRegular'
41+
const oddStyleDefaulted = oddStyle ?? 'bodyTextRegular'
42+
3843
return (
3944
<Flex display={DISPLAY_INLINE} {...styleProps}>
40-
<LegacyStyledText as={textStyle} display={DISPLAY_INLINE}>
45+
<StyledText
46+
desktopStyle={desktopStyleDefaulted}
47+
oddStyle={oddStyleDefaulted}
48+
display={DISPLAY_INLINE}
49+
>
4150
{`${t('at_step')} ${currentCopy}/${totalCopy}: `}
42-
</LegacyStyledText>
51+
</StyledText>
4352
{analysisCommand != null && protocolAnalysis != null ? (
4453
<CommandText
4554
command={analysisCommand}
4655
commandTextData={protocolAnalysis}
4756
robotType={robotType}
4857
display={DISPLAY_INLINE}
49-
as={textStyle}
58+
modernStyledTextDefaults={true}
59+
desktopStyle={desktopStyleDefaulted}
60+
oddStyle={oddStyleDefaulted}
5061
/>
5162
) : null}
5263
</Flex>

app/src/organisms/ErrorRecoveryFlows/shared/__tests__/StepInfo.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('StepInfo', () => {
2525
...mockRecoveryContentProps,
2626
protocolAnalysis: { commands: [mockFailedCommand] } as any,
2727
},
28-
textStyle: 'h4',
28+
desktopStyle: 'h4',
2929
stepCounts: {
3030
currentStepNumber: 5,
3131
totalStepCount: 10,

0 commit comments

Comments
 (0)