From 5528fffa007de6b186e8b4d633345cb1265d0e46 Mon Sep 17 00:00:00 2001 From: Frank Waalkens Date: Wed, 17 Jan 2024 10:55:35 +0100 Subject: [PATCH] Prop changes --- src/app/Marine2/components/boxes/Charger/Charger.tsx | 2 +- .../boxes/DevicesOverview/DevicesOverview.tsx | 2 +- .../components/ui/BatterySummary/BatterySummary.tsx | 11 ++++++----- src/app/Marine2/components/ui/ValueBox/ValueBox.tsx | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/app/Marine2/components/boxes/Charger/Charger.tsx b/src/app/Marine2/components/boxes/Charger/Charger.tsx index 8be4c80a5..b5f1243e0 100644 --- a/src/app/Marine2/components/boxes/Charger/Charger.tsx +++ b/src/app/Marine2/components/boxes/Charger/Charger.tsx @@ -30,7 +30,7 @@ import { formatModeFor } from "../../../utils/formatters/devices/charger/format- interface Props { instanceId: ChargerInstanceId componentMode?: ComponentMode - compactBoxSize?: ISize + compactBoxSize: ISize } const Charger = ({ instanceId, componentMode = "compact", compactBoxSize }: Props) => { diff --git a/src/app/Marine2/components/boxes/DevicesOverview/DevicesOverview.tsx b/src/app/Marine2/components/boxes/DevicesOverview/DevicesOverview.tsx index 038191363..8f05c0e2d 100644 --- a/src/app/Marine2/components/boxes/DevicesOverview/DevicesOverview.tsx +++ b/src/app/Marine2/components/boxes/DevicesOverview/DevicesOverview.tsx @@ -95,7 +95,7 @@ const getAvailableDeviceBoxes = function ( vebusInstanceId: InstanceId, generatorFp: GeneratorFpProvider, generatorRelay: GeneratorRelayProvider, - compactBoxSize: { width: number; height: number }, + compactBoxSize: ISize, componentMode?: ComponentMode ) { let devices = [] diff --git a/src/app/Marine2/components/ui/BatterySummary/BatterySummary.tsx b/src/app/Marine2/components/ui/BatterySummary/BatterySummary.tsx index 432406bff..221346207 100644 --- a/src/app/Marine2/components/ui/BatterySummary/BatterySummary.tsx +++ b/src/app/Marine2/components/ui/BatterySummary/BatterySummary.tsx @@ -4,6 +4,7 @@ import { formatValue } from "../../../utils/formatters" import { Battery } from "@victronenergy/mfd-modules" import classNames from "classnames" import { applyStyles, BreakpointStylesType } from "../../../utils/media" +import { ISize } from "@m2Types/generic/size" const styles: BreakpointStylesType = { default: { @@ -31,6 +32,11 @@ const styles: BreakpointStylesType = { }, } +interface Props { + battery: Battery + boxSize: ISize +} + const BatterySummary = ({ battery, boxSize }: Props) => { const activeStyles = applyStyles(boxSize, styles) @@ -73,9 +79,4 @@ const BatterySummary = ({ battery, boxSize }: Props) => { ) } -interface Props { - battery: Battery - boxSize: { width: number; height: number } -} - export default BatterySummary diff --git a/src/app/Marine2/components/ui/ValueBox/ValueBox.tsx b/src/app/Marine2/components/ui/ValueBox/ValueBox.tsx index 8b15f232a..514a06931 100644 --- a/src/app/Marine2/components/ui/ValueBox/ValueBox.tsx +++ b/src/app/Marine2/components/ui/ValueBox/ValueBox.tsx @@ -1,6 +1,6 @@ import Box from "../Box" import classNames from "classnames" -import { FC, ReactElement, useState } from "react" +import { FC, ReactElement, ReactNode, useState } from "react" import { applyStyles, defaultBoxStyles } from "../../../utils/media" import { ValueWithUnit } from "@m2Types/data/value-with-units" import { BottomValues } from "./BottomValues/BottomValues" @@ -17,8 +17,8 @@ interface Props { value?: number unit?: unit bottomValues: ValueWithUnit[][] - children?: JSX.Element | JSX.Element[] | string - buttons?: JSX.Element | JSX.Element[] + children?: ReactNode + buttons?: ReactNode | ReactNode[] infoText?: { title: string; body: string } valueSubtitle?: string status?: TStatus