-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app,components): add intervention modal to ODD (#13135)
makes necessary changes to the intervention modal and base modal components to display different layout/styling on ODD and desktop. adds the intervention modal to the RunningProtocol ODD page. re RLAB-323, closes RLAB-321, RLAB-324, RLAB-325
- Loading branch information
1 parent
42cb81e
commit a536c53
Showing
14 changed files
with
406 additions
and
157 deletions.
There are no files selected for viewing
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
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
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
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
51 changes: 44 additions & 7 deletions
51
app/src/organisms/InterventionModal/InterventionCommandMessage.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 |
---|---|---|
@@ -1,29 +1,66 @@ | ||
import * as React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { COLORS } from '@opentrons/components' | ||
import { css } from 'styled-components' | ||
|
||
import { | ||
COLORS, | ||
DIRECTION_COLUMN, | ||
Flex, | ||
RESPONSIVENESS, | ||
SPACING, | ||
TEXT_TRANSFORM_CAPITALIZE, | ||
TEXT_TRANSFORM_UPPERCASE, | ||
TYPOGRAPHY, | ||
} from '@opentrons/components' | ||
import { StyledText } from '../../atoms/text' | ||
|
||
const INTERVENTION_COMMAND_STYLE = css` | ||
flex-direction: ${DIRECTION_COLUMN}; | ||
grid-gap: ${SPACING.spacing4}; | ||
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { | ||
grid-gap: 0; | ||
} | ||
` | ||
|
||
const INTERVENTION_COMMAND_NOTES_STYLE = css` | ||
${TYPOGRAPHY.h6Default} | ||
color: ${COLORS.errorDisabled}; | ||
text-transform: ${TEXT_TRANSFORM_UPPERCASE}; | ||
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { | ||
${TYPOGRAPHY.smallBodyTextBold} | ||
color: ${COLORS.darkBlack100}; | ||
text-transform: ${TEXT_TRANSFORM_CAPITALIZE}; | ||
} | ||
` | ||
|
||
const INTERVENTION_COMMAND_MESSAGE_STYLE = css` | ||
${TYPOGRAPHY.pRegular} | ||
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { | ||
${TYPOGRAPHY.smallBodyTextRegular} | ||
} | ||
` | ||
|
||
export interface InterventionCommandMessageProps { | ||
commandMessage: string | null | ||
} | ||
|
||
export function InterventionCommandMessage({ | ||
commandMessage, | ||
}: InterventionCommandMessageProps): JSX.Element { | ||
const { t, i18n } = useTranslation('protocol_command_text') | ||
const { t } = useTranslation('protocol_command_text') | ||
|
||
return ( | ||
<> | ||
<StyledText as="h6" color={COLORS.errorDisabled}> | ||
{i18n.format(t('notes'), 'upperCase')}: | ||
<Flex css={INTERVENTION_COMMAND_STYLE}> | ||
<StyledText css={INTERVENTION_COMMAND_NOTES_STYLE}> | ||
{t('notes')} | ||
</StyledText> | ||
<StyledText as="p"> | ||
<StyledText css={INTERVENTION_COMMAND_MESSAGE_STYLE}> | ||
{commandMessage != null && commandMessage !== '' | ||
? commandMessage.length > 220 | ||
? `${commandMessage.substring(0, 217)}...` | ||
: commandMessage | ||
: t('wait_for_resume')} | ||
</StyledText> | ||
</> | ||
</Flex> | ||
) | ||
} |
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
Oops, something went wrong.