-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): add heater shaker wizard key parts page (#9499)
This PR adds the heater shaker wizard key parts component.
- Loading branch information
Showing
5 changed files
with
145 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,99 @@ | ||
import React from 'react' | ||
import { Trans, useTranslation } from 'react-i18next' | ||
import { css } from 'styled-components' | ||
import { | ||
ALIGN_FLEX_START, | ||
COLORS, | ||
DIRECTION_COLUMN, | ||
DIRECTION_ROW, | ||
Flex, | ||
JUSTIFY_SPACE_BETWEEN, | ||
SPACING, | ||
Text, | ||
TYPOGRAPHY, | ||
} from '@opentrons/components' | ||
import HeaterShakerKeyParts from '../../../assets/images/heater-shaker-key-parts.png' | ||
import HeaterShakerDeckLock from '../../../assets/videos/heater-shaker-setup/HS_Deck_Lock_Anim.webm' | ||
|
||
export function KeyParts(): JSX.Element { | ||
return <div>KeyParts</div> | ||
const { t } = useTranslation('heater_shaker') | ||
return ( | ||
<> | ||
<Text | ||
color={COLORS.darkBlack} | ||
paddingTop={SPACING.spacing3} | ||
fontWeight={TYPOGRAPHY.fontWeightBold} | ||
data-testid={'heater_shaker_wizard_keyparts_title'} | ||
> | ||
{t('heater_shaker_key_parts')} | ||
</Text> | ||
<Text | ||
color={COLORS.darkBlack} | ||
paddingTop={SPACING.spacing3} | ||
fontWeight={TYPOGRAPHY.fontWeightRegular} | ||
data-testid={'heater_shaker_wizard_keyparts_subtitle'} | ||
> | ||
<Trans | ||
t={t} | ||
i18nKey={'heater_shaker_orient_module'} | ||
components={{ | ||
bold: <strong />, | ||
}} | ||
/> | ||
</Text> | ||
<Flex | ||
flexDirection={DIRECTION_ROW} | ||
marginY={SPACING.spacing6} | ||
alignItems={ALIGN_FLEX_START} | ||
> | ||
<img src={HeaterShakerKeyParts} alt="Heater Shaker Key Parts" /> | ||
|
||
<Flex | ||
flexDirection={DIRECTION_COLUMN} | ||
justifyContent={JUSTIFY_SPACE_BETWEEN} | ||
marginTop={'8rem'} | ||
marginRight={SPACING.spacing6} | ||
> | ||
<Trans | ||
t={t} | ||
i18nKey={'heater_shaker_latch_description'} | ||
components={{ | ||
bold: <strong />, | ||
block: ( | ||
<Text | ||
fontSize={TYPOGRAPHY.fontSizeP} | ||
marginBottom={SPACING.spacing4} | ||
/> | ||
), | ||
}} | ||
/> | ||
<Trans | ||
t={t} | ||
i18nKey={'heater_shaker_anchor_description'} | ||
components={{ | ||
bold: <strong />, | ||
block: ( | ||
<Text | ||
fontSize={TYPOGRAPHY.fontSizeP} | ||
marginBottom={SPACING.spacing4} | ||
/> | ||
), | ||
}} | ||
/> | ||
<video | ||
css={css` | ||
max-width: 100%; | ||
max-height: 10rem; | ||
`} | ||
autoPlay={true} | ||
loop={true} | ||
controls={false} | ||
data-testid={'heater_shaker_deck_lock'} | ||
> | ||
<source src={HeaterShakerDeckLock} /> | ||
</video> | ||
</Flex> | ||
</Flex> | ||
</> | ||
) | ||
} |
45 changes: 45 additions & 0 deletions
45
app/src/organisms/Devices/HeaterShakerWizard/__tests__/KeyParts.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as React from 'react' | ||
import { nestedTextMatcher, renderWithProviders } from '@opentrons/components' | ||
import { i18n } from '../../../../i18n' | ||
import { KeyParts } from '../KeyParts' | ||
|
||
const render = () => { | ||
return renderWithProviders(<KeyParts />, { | ||
i18nInstance: i18n, | ||
})[0] | ||
} | ||
|
||
describe('KeyParts', () => { | ||
it('renders correct title, image and body', () => { | ||
const { getByText, getByAltText, getByTestId } = render() | ||
|
||
getByText('Key Heater Shaker parts and terminology') | ||
getByText( | ||
nestedTextMatcher( | ||
'Orient the module so its power ports face away from you.' | ||
) | ||
) | ||
getByText( | ||
nestedTextMatcher( | ||
'The Labware Latch keeps labware secure while the module is shaking.' | ||
) | ||
) | ||
getByText( | ||
'It can be opened or closed manually and with software but is closed and locked while the module is shaking.' | ||
) | ||
getByText( | ||
nestedTextMatcher( | ||
'The 2 Anchors keep the module attached to the deck while it is shaking.' | ||
) | ||
) | ||
getByText( | ||
'The screw above each anchor is used to extend and retract them. See animation below.' | ||
) | ||
getByText( | ||
'Extending the bolts slightly increases the module’s footprint, which allows it to be more firmly attached to the edges of a slot.' | ||
) | ||
getByAltText('Heater Shaker Key Parts') | ||
|
||
getByTestId('heater_shaker_deck_lock') | ||
}) | ||
}) |