From f0d37c46d74dd4c2ff2289deb97a0db4ec20aa34 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:46:57 +0300 Subject: [PATCH] [ENG-1456] General UI Tweaks (#1819) * General UI Tweaks * Update general.tsx * Update general.tsx --- interface/app/$libraryId/settings/Setting.tsx | 3 ++- .../$libraryId/settings/client/general.tsx | 26 +++++++++---------- packages/ui/src/Select.tsx | 3 ++- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/interface/app/$libraryId/settings/Setting.tsx b/interface/app/$libraryId/settings/Setting.tsx index 9bec2b5c2..264acbdb4 100644 --- a/interface/app/$libraryId/settings/Setting.tsx +++ b/interface/app/$libraryId/settings/Setting.tsx @@ -10,6 +10,7 @@ interface Props { description?: string | JSX.Element; mini?: boolean; className?: string; + containerClassName?: string; toolTipLabel?: string | boolean; infoUrl?: string; } @@ -22,7 +23,7 @@ export default ({ mini, registerName, ...props }: PropsWithChildren) => { return ( <> -
+

{props.title}

diff --git a/interface/app/$libraryId/settings/client/general.tsx b/interface/app/$libraryId/settings/client/general.tsx index 1a174a545..f636bb17b 100644 --- a/interface/app/$libraryId/settings/client/general.tsx +++ b/interface/app/$libraryId/settings/client/general.tsx @@ -1,5 +1,4 @@ import clsx from 'clsx'; -import { useEffect } from 'react'; import { Controller, FormProvider } from 'react-hook-form'; import { getDebugState, @@ -82,13 +81,11 @@ export const Component = () => { node.refetch(); }); - useEffect(() => { - form.watch((data) => { - if (Number(data.p2p_port) > 65535) { - form.setValue('p2p_port', 65535); - } - }); - }, [form]); + form.watch((data) => { + if (Number(data.p2p_port) > 65535) { + form.setValue('p2p_port', 65535); + } + }); return ( @@ -184,9 +181,10 @@ export const Component = () => { - @@ -209,7 +207,7 @@ export const Component = () => { title="Thumbnailer CPU usage" description="Limit how much CPU the thumbnailer can use for background processing." > -
+
{ if (value.length > 0) { @@ -222,7 +220,8 @@ export const Component = () => { value={[watchBackgroundProcessingPercentage]} /> { title="Networking Port" description="The port for Spacedrive's Peer-to-peer networking to communicate on. You should leave this disabled unless you have a restictive firewall. Do not expose to the internet!" > -
+
(