Skip to content

Commit

Permalink
Dashboard : Device value on 2 lines
Browse files Browse the repository at this point in the history
  • Loading branch information
atrovato committed Nov 8, 2020
1 parent 6fb3e75 commit def354e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Text } from 'preact-i18n';
import get from 'get-value';
import cx from 'classnames';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';

Expand All @@ -23,7 +24,7 @@ const SensorDeviceType = ({ children, ...props }) => (
</td>
<td>{props.deviceFeature.name}</td>
{SPECIAL_SENSORS.indexOf(props.deviceFeature.category) === -1 && (
<td class="text-right">
<td class={cx('text-right', { 'text-nowrap': props.deviceFeature.last_value !== null })}>
{props.deviceFeature.last_value !== null && props.deviceFeature.last_value}
{props.deviceFeature.last_value === null && <Text id="dashboard.boxes.devicesInRoom.noValue" />}
{props.deviceFeature.last_value !== null && (
Expand Down Expand Up @@ -51,7 +52,7 @@ const SensorDeviceType = ({ children, ...props }) => (
</td>
)}
{props.deviceFeature.category === DEVICE_FEATURE_CATEGORIES.MOTION_SENSOR && (
<td class="text-right">
<td class="text-right text-nowrap">
{!props.deviceFeature.last_value_changed && <Text id="dashboard.boxes.devicesInRoom.noValue" />}
{props.deviceFeature.last_value_changed &&
dayjs(props.deviceFeature.last_value_changed)
Expand Down

0 comments on commit def354e

Please sign in to comment.