Skip to content

Commit

Permalink
perf(ui): remove info button on dev mode alert
Browse files Browse the repository at this point in the history
  • Loading branch information
skjsjhb committed Jan 16, 2025
1 parent b3972f0 commit c8887b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
16 changes: 4 additions & 12 deletions public/i18n/zh-CN/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ settings:
network: 网络
dev: 开发
dev-warn: 这些设置只用于开发,请绝不要随意修改!
dev-warn-more: 为什么?
entries:
username:
title: 您的昵称
Expand Down Expand Up @@ -59,7 +58,7 @@ settings:
devtools:
title: DevTools
sub: 启用渲染进程的 DevTools 以检查报告的错误。


about:
title: 关于
Expand All @@ -82,16 +81,9 @@ about:
source: 查看源代码
license: 查看许可证

deps: |-
以下是构造此 Alicorn 所使用的软件包,诚挚地向它们的开发者表示谢意。
包含在产品中:
{{prodNames}}
仅在开发时使用:
{{devNames}}
packages:
name: 包名称
ver: 版本号

features-note: 若要使用未启用的功能,请重新构建 Alicorn,并打开相应的开关。
features-how: 进一步了解
Expand Down
11 changes: 1 addition & 10 deletions src/renderer/pages/settings/DevTab.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
import { Alert, Button } from "@nextui-org/react";
import { Alert } from "@nextui-org/react";
import { OnOffEntry } from "@pages/settings/SettingsEntry";
import { useConfig } from "@pages/settings/use-config";
import { CodescanIcon } from "@primer/octicons-react";
import React, { FC } from "react";
import { useTranslation } from "react-i18next";

const DO_NOT_OPEN_DEV_MODE_URL = "https://www.electronjs.org/docs/latest/tutorial/security";

export const DevTab: FC = () => {
const { t } = useTranslation("pages", { keyPrefix: "settings" });

const [config, makeReduce] = useConfig();

if (!config) return;

function whyNotDevMode() {
native.ext.openURL(DO_NOT_OPEN_DEV_MODE_URL);
}

return <>
<Alert
color="danger"
title={t("dev-warn")}
description=""
endContent={
<Button onPress={whyNotDevMode} color="danger">{t("dev-warn-more")}</Button>
}
/>

<OnOffEntry
Expand Down

0 comments on commit c8887b9

Please sign in to comment.