From 496c358d2cc2ef96dc9557d1cb4b7be2e10f7460 Mon Sep 17 00:00:00 2001 From: The1111mp Date: Sat, 31 Aug 2024 16:24:33 +0800 Subject: [PATCH] fix: experience optimization (https://github.com/1111mp/nvm-desktop/issues/104) Signed-off-by: The1111mp --- _locales/en/messages.json | 12 +++++ _locales/zh_CN/messages.json | 12 +++++ src/renderer/src/components/ui/ip-input.tsx | 2 +- src/renderer/src/pages/home/index.tsx | 50 +++++++++++---------- src/renderer/src/pages/home/setting.tsx | 4 +- 5 files changed, 53 insertions(+), 27 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 47a92ed..695bcfc 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -526,5 +526,17 @@ "Input-To-Search": { "message": "input to search", "description": "The text of the Input-To-Search" + }, + "Proxy": { + "message": "Proxy", + "description": "The text of the Proxy" + }, + "Enabled": { + "message": "Enabled", + "description": "The text of the Enabled" + }, + "Disabled": { + "message": "Disabled", + "description": "The text of the Disabled" } } diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index f5b4d1b..64b94cd 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -526,5 +526,17 @@ "Input-To-Search": { "message": "输入以搜索", "description": "The text of the Input-To-Search" + }, + "Proxy": { + "message": "代理", + "description": "The text of the Proxy" + }, + "Enabled": { + "message": "启用", + "description": "The text of the Enabled" + }, + "Disabled": { + "message": "禁用", + "description": "The text of the Disabled" } } diff --git a/src/renderer/src/components/ui/ip-input.tsx b/src/renderer/src/components/ui/ip-input.tsx index ea4ced9..107c0ed 100644 --- a/src/renderer/src/components/ui/ip-input.tsx +++ b/src/renderer/src/components/ui/ip-input.tsx @@ -12,7 +12,7 @@ const IpInput: React.FC = memo( forwardRef( ({ className, disabled = false, value: propValue = "...", onChange }, ref) => { const [value, setValue] = useState(() => - (propValue === null ? "..." : propValue)?.split(".") + (!propValue ? "..." : propValue)?.split(".") ); const [focus, setFocus] = useState(false); diff --git a/src/renderer/src/pages/home/index.tsx b/src/renderer/src/pages/home/index.tsx index d2753dd..66d296a 100644 --- a/src/renderer/src/pages/home/index.tsx +++ b/src/renderer/src/pages/home/index.tsx @@ -396,24 +396,6 @@ const Home: React.FC = () => { ) : (
-
- -
@@ -455,12 +437,32 @@ const Home: React.FC = () => {
-
- {platform === "win32" && } - - - - +
+
+ {platform === "win32" && } + + + + +
+
+
)} diff --git a/src/renderer/src/pages/home/setting.tsx b/src/renderer/src/pages/home/setting.tsx index 1a5c65a..0c6a697 100644 --- a/src/renderer/src/pages/home/setting.tsx +++ b/src/renderer/src/pages/home/setting.tsx @@ -341,7 +341,7 @@ export const Setting: React.FC = memo(() => { const { enabled } = field.value; return ( - Proxy + {i18n("Proxy")}
= memo(() => { - {field.value ? "Enabled" : "Disabled"} + {i18n(field.value ? "Enabled" : "Disabled")} )}