From 349275b908a51db0a15376cea3b0299a331ea06f Mon Sep 17 00:00:00 2001 From: Ravinou Date: Thu, 2 Jan 2025 11:18:07 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=9A=A1=20switch=20and=20storageb?= =?UTF-8?q?ar=20ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Components/UI/StorageBar/StorageBar.tsx | 7 ++++++- Components/UI/Switch/Switch.tsx | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Components/UI/StorageBar/StorageBar.tsx b/Components/UI/StorageBar/StorageBar.tsx index 62142dc..f6b2fc5 100644 --- a/Components/UI/StorageBar/StorageBar.tsx +++ b/Components/UI/StorageBar/StorageBar.tsx @@ -1,7 +1,12 @@ //Lib import classes from './StorageBar.module.css'; -export default function StorageBar(props) { +type StorageBarProps = { + storageUsed: number; + storageSize: number; +}; + +export default function StorageBar(props: StorageBarProps) { //Var //storageUsed is in kB, storageSize is in GB. Round to 1 decimal for %. const storageUsedPercent = (((props.storageUsed / 1024 ** 2) * 100) / props.storageSize).toFixed( diff --git a/Components/UI/Switch/Switch.tsx b/Components/UI/Switch/Switch.tsx index 36ae47f..89efae1 100644 --- a/Components/UI/Switch/Switch.tsx +++ b/Components/UI/Switch/Switch.tsx @@ -1,7 +1,16 @@ //Lib +import { Optional } from '~/types'; import classes from './Switch.module.css'; -export default function Switch(props) { +type SwitchProps = { + switchName: string; + switchDescription: string; + checked: Optional; + disabled: boolean; + onChange: (checked: boolean) => void; +}; + +export default function Switch(props: SwitchProps) { return ( <>