Skip to content

Commit

Permalink
Capitalize lid status for absorbance reader car
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Nov 21, 2024
1 parent 6f5d438 commit 9c559ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/src/assets/localization/en/shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"change_robot": "Change robot",
"clear_data": "clear data",
"close": "close",
"closed": "closed",
"close_robot_door": "Close the robot door before starting the run.",
"confirm": "Confirm",
"confirm_placement": "Confirm placement",
Expand Down
8 changes: 6 additions & 2 deletions app/src/organisms/ModuleCard/AbsorbanceReaderData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const AbsorbanceReaderData = (
props: AbsorbanceReaderProps
): JSX.Element | null => {
const { moduleData } = props
const { t } = useTranslation('device_details')
const { t, i18n } = useTranslation(['device_details', 'shared'])

const StatusLabelProps = {
status: 'Idle',
Expand All @@ -37,6 +37,10 @@ export const AbsorbanceReaderData = (
break
}
}
const lidDisplayStatus =
moduleData.lidStatus === 'on'
? i18n.format(t('shared:closed'), 'capitalize')
: i18n.format(t('shared:open'), 'capitalize')

return (
<>
Expand All @@ -46,7 +50,7 @@ export const AbsorbanceReaderData = (
data-testid="abs_module_data"
>
{t('abs_reader_lid_status', {
status: moduleData.lidStatus === 'on' ? 'closed' : 'open',
status: lidDisplayStatus,
})}
</StyledText>
</>
Expand Down

0 comments on commit 9c559ca

Please sign in to comment.