From f7d5ffef720786617f311a84f94ce972d44eaa6a Mon Sep 17 00:00:00 2001 From: Prozilla Date: Mon, 4 Mar 2024 11:18:49 +0100 Subject: [PATCH] Minor QOL changes --- src/components/apps/calculator/Calculator.jsx | 21 ++++--------------- .../apps/file-explorer/FileExplorer.jsx | 1 + .../apps/settings/Settings.module.css | 5 +++++ .../apps/settings/tabs/AppsSettings.jsx | 4 +++- src/components/taskbar/menus/SearchMenu.jsx | 3 +++ src/features/apps/appsManager.js | 1 + 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/components/apps/calculator/Calculator.jsx b/src/components/apps/calculator/Calculator.jsx index 60da984..1e3b455 100644 --- a/src/components/apps/calculator/Calculator.jsx +++ b/src/components/apps/calculator/Calculator.jsx @@ -10,18 +10,12 @@ export function Calculator({ active }) { const [operation, setOperation] = useState(null); const [isIntermediate, setIsIntermediate] = useState(false); - const log = useCallback(() => { - console.info({ input, firstNumber, secondNumber, operation }); - }, [firstNumber, input, operation, secondNumber]); - const reset = useCallback(() => { setInput("0"); setFirstNumber(null); setSecondNumber(null); setOperation(null); - - log(); - }, [log]); + }, []); const addInput = useCallback((string) => { let hasReset = false; @@ -57,8 +51,7 @@ export function Calculator({ active }) { setInput(input + string); } - log(); - }, [input, isIntermediate, log, reset, secondNumber]); + }, [input, isIntermediate, reset, secondNumber]); const calculate = useCallback((intermediate = false) => { if (firstNumber == null) { @@ -89,9 +82,7 @@ export function Calculator({ active }) { } setIsIntermediate(intermediate); - - log(); - }, [firstNumber, input, log, operation]); + }, [firstNumber, input, operation]); const changeOperation = useCallback((operation) => { if (firstNumber != null && secondNumber == null) { @@ -103,17 +94,13 @@ export function Calculator({ active }) { } setOperation(operation); - - log(); - }, [calculate, firstNumber, input, log, secondNumber]); + }, [calculate, firstNumber, input, secondNumber]); useEffect(() => { const onKeyDown = (event) => { if (!active) return; - console.log(event.key); - event.preventDefault(); switch (event.key) { diff --git a/src/components/apps/file-explorer/FileExplorer.jsx b/src/components/apps/file-explorer/FileExplorer.jsx index 0c75af7..a8bfb1e 100644 --- a/src/components/apps/file-explorer/FileExplorer.jsx +++ b/src/components/apps/file-explorer/FileExplorer.jsx @@ -214,6 +214,7 @@ export function FileExplorer({ startPath, selectorMode, Footer, modalsManager, o tabIndex={0} onChange={onPathChange} onKeyDown={onKeyDown} + placeholder="Enter a path..." />