diff --git a/app/src/components/ModuleLiveStatusCards/ThermocyclerCard.js b/app/src/components/ModuleLiveStatusCards/ThermocyclerCard.js
index d4c24453252..da5270000dc 100644
--- a/app/src/components/ModuleLiveStatusCards/ThermocyclerCard.js
+++ b/app/src/components/ModuleLiveStatusCards/ThermocyclerCard.js
@@ -1,17 +1,17 @@
// @flow
import * as React from 'react'
-import { addSeconds, format } from 'date-fns'
import cx from 'classnames'
import { LabeledValue } from '@opentrons/components'
import { getModuleDisplayName } from '@opentrons/shared-data'
+import type { ThermocyclerModule, ModuleCommand } from '../../modules/types'
+import { formatSeconds } from '../../robot/selectors' // TODO: move helper from robot selector to helper file
import { TemperatureControl, TemperatureData } from '../ModuleControls'
+
import { StatusCard } from './StatusCard'
import { StatusItem } from './StatusItem'
import styles from './styles.css'
-import type { ThermocyclerModule, ModuleCommand } from '../../modules/types'
-
const TimeRemaining = ({
holdTime,
title,
@@ -23,10 +23,7 @@ const TimeRemaining = ({
className={cx(styles.inline_labeled_value, styles.time_remaining_wrapper)}
>
Time remaining for step:
-
- {// convert duration to seconds from epoch (midnight), then format
- format(addSeconds(0, holdTime ?? 0), 'HH:mm:ss')}
-
+ {formatSeconds(holdTime ?? 0)}
)
@@ -53,19 +50,31 @@ const CycleInfo = ({
return null
}
return (
-
-
-
-
-
+ <>
+
+ >
)
}
diff --git a/app/src/components/ModuleLiveStatusCards/styles.css b/app/src/components/ModuleLiveStatusCards/styles.css
index 095c9bdd975..8d989a5e8b3 100644
--- a/app/src/components/ModuleLiveStatusCards/styles.css
+++ b/app/src/components/ModuleLiveStatusCards/styles.css
@@ -46,6 +46,7 @@ updated component library cards after redesign/refactor
max-width: 7rem;
}
+.cycle_data_item,
.temp_data_item {
flex: 1 1 0;
}
@@ -72,3 +73,14 @@ updated component library cards after redesign/refactor
.status_item_wrapper {
flex: 1 1 0;
}
+
+.cycle_info_wrapper {
+ display: flex;
+ flex-direction: column;
+ align-items: stretch;
+}
+
+.cycle_info_counts {
+ display: flex;
+ flex-direction: row;
+}
\ No newline at end of file
diff --git a/app/src/robot/selectors.js b/app/src/robot/selectors.js
index 786d8601f38..36bcf6dcb94 100644
--- a/app/src/robot/selectors.js
+++ b/app/src/robot/selectors.js
@@ -212,16 +212,18 @@ export const getRunSeconds = createSelector(
}
)
+export function formatSeconds(runSeconds: number): string {
+ const hours = padStart(`${Math.floor(runSeconds / 3600)}`, 2, '0')
+ const minutes = padStart(`${Math.floor(runSeconds / 60) % 60}`, 2, '0')
+ const seconds = padStart(`${runSeconds % 60}`, 2, '0')
+
+ return `${hours}:${minutes}:${seconds}`
+}
+
// $FlowFixMe: (mc, 2019-04-17): untyped RPC state selector
export const getRunTime = createSelector(
getRunSeconds,
- (runSeconds): string => {
- const hours = padStart(`${Math.floor(runSeconds / 3600)}`, 2, '0')
- const minutes = padStart(`${Math.floor(runSeconds / 60) % 60}`, 2, '0')
- const seconds = padStart(`${runSeconds % 60}`, 2, '0')
-
- return `${hours}:${minutes}:${seconds}`
- }
+ formatSeconds
)
export function getCalibrationRequest(state: State) {