Skip to content

Commit

Permalink
address feedback and fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Mar 13, 2024
1 parent 89d8b7c commit aa8f55b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
26 changes: 9 additions & 17 deletions app/src/atoms/Slideout/MultiSlideout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ export default {
const Template: Story<React.ComponentProps<typeof MultiSlideout>> = args => {
const [firstPage, setFirstPage] = React.useState<boolean>(false)

const togglePage = () => {
const togglePage = (): void => {
setFirstPage(prevState => !prevState)
}

const Children = (
<React.Fragment>
<StyledText
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
fontSize={TYPOGRAPHY.fontSizeP}
>
const children = (
<>
<StyledText as="p">
{firstPage ? 'first page body' : 'second page body'}
</StyledText>

Expand All @@ -33,22 +30,17 @@ const Template: Story<React.ComponentProps<typeof MultiSlideout>> = args => {
backgroundColor={COLORS.blue50}
textTransform={TYPOGRAPHY.textTransformNone}
>
<StyledText
fontWeight={TYPOGRAPHY.fontWeightRegular}
fontSize={TYPOGRAPHY.fontSizeP}
>
<StyledText as="p">
{firstPage ? 'Go to Second Page' : 'Go to First Page'}
</StyledText>
</PrimaryBtn>
</React.Fragment>
</>
)

return (
<MultiSlideout
{...args}
children={Children}
currentStep={firstPage ? 1 : 2}
/>
<MultiSlideout {...args} currentStep={firstPage ? 1 : 2}>
{children}
</MultiSlideout>
)
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/atoms/Slideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const Slideout = (props: SlideoutProps): JSX.Element => {
flexDirection={DIRECTION_COLUMN}
justifyContent={JUSTIFY_SPACE_BETWEEN}
>
{multiSlideoutSpecs == null ? null : (
{multiSlideoutSpecs === undefined ? null : (
<StyledText
as="p"
color={COLORS.grey60}
Expand Down
9 changes: 4 additions & 5 deletions app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Icon,
Flex,
DIRECTION_COLUMN,
SIZE_1,
PrimaryButton,
DIRECTION_ROW,
SecondaryButton,
Expand Down Expand Up @@ -145,7 +144,7 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
? mostRecentAnalysis?.robotType ?? null
: null

const singlePageButtonWithoutFF = (
const SinglePageButtonWithoutFF = (
<PrimaryButton
disabled={
isCreatingRun ||
Expand All @@ -156,7 +155,7 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
onClick={handleProceed}
>
{isCreatingRun ? (
<Icon name="ot-spinner" spin size={SIZE_1} />
<Icon name="ot-spinner" spin size="1rem" />
) : (
t('shared:proceed_to_setup')
)}
Expand Down Expand Up @@ -206,15 +205,15 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
</SecondaryButton>
<PrimaryButton width="50%" onClick={handleProceed}>
{isCreatingRun ? (
<Icon name="ot-spinner" spin size={SIZE_1} />
<Icon name="ot-spinner" spin size="1rem" />
) : (
t('shared:confirm_values')
)}
</PrimaryButton>
</Flex>
)
) : (
singlePageButtonWithoutFF
SinglePageButtonWithoutFF
)}
</Flex>
}
Expand Down

0 comments on commit aa8f55b

Please sign in to comment.