Skip to content

Commit

Permalink
fix: experience optimization (#104)
Browse files Browse the repository at this point in the history
Signed-off-by: The1111mp <The1111mp@outlook.com>
  • Loading branch information
1111mp committed Aug 31, 2024
1 parent 45660ef commit 496c358
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 27 deletions.
12 changes: 12 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
12 changes: 12 additions & 0 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/renderer/src/components/ui/ip-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const IpInput: React.FC<IpInputProps> = memo(
forwardRef<HTMLDivElement, IpInputProps>(
({ className, disabled = false, value: propValue = "...", onChange }, ref) => {
const [value, setValue] = useState<string[]>(() =>
(propValue === null ? "..." : propValue)?.split(".")
(!propValue ? "..." : propValue)?.split(".")
);
const [focus, setFocus] = useState<boolean>(false);

Expand Down
50 changes: 26 additions & 24 deletions src/renderer/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,24 +396,6 @@ const Home: React.FC = () => {
) : (
<header className="flex items-center pt-2 px-3 justify-between select-none [-webkit-app-region:drag]">
<div className="flex items-center gap-3">
<div className="flex items-center gap-1 [-webkit-app-region:no-drag]">
<Button
size="sm"
variant="secondary"
icon={<Cross2Icon />}
onClick={() => {
window.Context.windowClose();
}}
></Button>
<Button
size="sm"
variant="secondary"
icon={<MinusIcon />}
onClick={() => {
window.Context.windowMinimize();
}}
/>
</div>
<NavigationMenu>
<NavigationMenuList className="[-webkit-app-region:no-drag]">
<NavigationMenuItem>
Expand Down Expand Up @@ -455,12 +437,32 @@ const Home: React.FC = () => {
</NavigationMenuList>
</NavigationMenu>
</div>
<div className="flex items-center [-webkit-app-region:no-drag]">
{platform === "win32" && <Updater />}
<ThemeCustomizer />
<Tip />
<Configration />
<Setting />
<div className="flex items-center gap-4 [-webkit-app-region:no-drag]">
<div className="flex items-center [-webkit-app-region:no-drag]">
{platform === "win32" && <Updater />}
<ThemeCustomizer />
<Tip />
<Configration />
<Setting />
</div>
<div className="flex items-center gap-2">
<Button
size="sm"
variant="secondary"
icon={<MinusIcon />}
onClick={() => {
window.Context.windowMinimize();
}}
/>
<Button
size="sm"
variant="secondary"
icon={<Cross2Icon />}
onClick={() => {
window.Context.windowClose();
}}
/>
</div>
</div>
</header>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/pages/home/setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export const Setting: React.FC<Props> = memo(() => {
const { enabled } = field.value;
return (
<FormItem>
<FormLabel className="text-muted-foreground">Proxy</FormLabel>
<FormLabel className="text-muted-foreground">{i18n("Proxy")}</FormLabel>
<div className="space-y-4">
<FormField
control={form.control}
Expand All @@ -352,7 +352,7 @@ export const Setting: React.FC<Props> = memo(() => {
<Switch checked={field.value} onCheckedChange={field.onChange} />
</FormControl>
<FormDescription className="!mt-0">
{field.value ? "Enabled" : "Disabled"}
{i18n(field.value ? "Enabled" : "Disabled")}
</FormDescription>
</FormItem>
)}
Expand Down

0 comments on commit 496c358

Please sign in to comment.