Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit f5f81d9

Browse files
committed
fix(ui): dark mode
1 parent aa2c81e commit f5f81d9

File tree

10 files changed

+53
-23
lines changed

10 files changed

+53
-23
lines changed

src/components/TinyInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const TinyInput = forwardRef(
1010
ref?: LegacyRef<HTMLInputElement>
1111
) => (
1212
<input
13-
className="border-b border-blue-500 focus:outline-none"
13+
className="border-b border-blue-500 dark:bg-gray-800 focus:outline-none"
1414
defaultValue={props.initialValue}
1515
onKeyDown={(e) => {
1616
if (e.key === "Enter") props.onSubmit(e.currentTarget.value);

src/intl/root.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export default {
1111
preparing: "Preparing",
1212
waiting: "Waiting to Launch",
1313
},
14+
install: "Install",
15+
official: "Official",
1416
downloading: {
1517
lib: "Downloading Libraries",
1618
asset: "Downloading Assets",
@@ -105,6 +107,14 @@ export default {
105107
githubHomepage: "GitHub Homepage",
106108
downloadProvider: "Download Provider",
107109
oss: "Open Source Software",
110+
theme: "Theme",
111+
os: "Operating System",
112+
themes: {
113+
followOs: "Follow OS",
114+
light: "Light",
115+
dark: "Dark",
116+
},
117+
autoCollapse: "Automatically Collapse Sidebar",
108118
},
109119
toast: {
110120
copied: "Copied successfully.",

src/intl/zh-cn.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ export default {
44
messages: {
55
counter: {
66
increase: "增加",
7-
clicked: (count: number) =>
8-
`你已经点击这个按钮 ${count} 次。`,
7+
clicked: (count: number) => `你已经点击这个按钮 ${count} 次。`,
98
},
109
launching: {
1110
preparing: "准备中",
1211
waiting: "等待游戏启动中",
1312
},
13+
install: "安装",
14+
official: "官方",
1415
downloading: {
1516
lib: "正在下载游戏库",
1617
asset: "正在下载游戏资源",
1718
clientJar: "正在下载客户端 jar 文件",
1819
clientJson: "正在下载客户端 json 文件",
1920
minecraft: {
20-
success: (version: string) =>
21-
`Minecraft ${version} 安装成功。`,
21+
success: (version: string) => `Minecraft ${version} 安装成功。`,
2222
failed: (version: string) => `Minecraft ${version} 下载失败。`,
2323
},
2424
},
@@ -59,8 +59,7 @@ export default {
5959
offline: "离线登录",
6060
authserver: "验证服务器",
6161
type: "账户类型",
62-
removeConfirmation: (name: string) =>
63-
`是否要移除账户 ${name} ?`,
62+
removeConfirmation: (name: string) => `是否要移除账户 ${name} ?`,
6463
token: {
6564
validate: "检查令牌状态",
6665
available: "令牌可用",
@@ -73,11 +72,9 @@ export default {
7372
gameDirHelper:
7473
"通常是 Windows 或 Linux 上的 '.minecraft' 文件夹和 macOS 上的 'minecraft' 文件夹。",
7574
version: "版本",
76-
versionHelper:
77-
"游戏文件夹中的 'versions' 文件夹中的文件夹名。",
75+
versionHelper: "游戏文件夹中的 'versions' 文件夹中的文件夹名。",
7876
unopened: "在左侧打开一个实例或者创建新实例。",
79-
removeConfirmation: (name: string) =>
80-
`是否要移除实例 ${name} ?`,
77+
removeConfirmation: (name: string) => `是否要移除实例 ${name} ?`,
8178
release: "正式版",
8279
snapshot: "快照",
8380
old: "远古版",
@@ -105,6 +102,14 @@ export default {
105102
githubHomepage: "GitHub 首页",
106103
downloadProvider: "下载源",
107104
oss: "开源软件",
105+
theme: "主题",
106+
os: "操作系统",
107+
themes: {
108+
followOs: "跟随操作系统",
109+
light: "浅色主题",
110+
dark: "深色主题",
111+
},
112+
autoCollapse: "自动收起侧边栏",
108113
},
109114
toast: {
110115
copied: "已成功复制。",

src/intl/zh-fs.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export default {
1111
preparing: "预备发射",
1212
waiting: "请等待发射开始",
1313
},
14+
install: "安设",
15+
official: "负责人的",
1416
downloading: {
1517
lib: "向下加载图书馆",
1618
asset: "向下加载资产",
@@ -19,7 +21,8 @@ export default {
1921
minecraft: {
2022
success: (version: string) =>
2123
`非常好下载源,使您对 Minecraft ${version} 的安设成功。`,
22-
failed: (version: string) => `非常坏下载源,使您对于 Minecraft ${version} 的安设成功。`,
24+
failed: (version: string) =>
25+
`非常坏下载源,使您对于 Minecraft ${version} 的安设成功。`,
2326
},
2427
},
2528
installs: {
@@ -59,8 +62,7 @@ export default {
5962
offline: "脱机",
6063
authserver: "身份验证服务器",
6164
type: "打字",
62-
removeConfirmation: (name: string) =>
63-
`您真的想要除掉帐单 ${name} 吗?`,
65+
removeConfirmation: (name: string) => `您真的想要除掉帐单 ${name} 吗?`,
6466
token: {
6567
validate: "查询令牌状态",
6668
available: "令牌是可以使用的。",
@@ -73,8 +75,7 @@ export default {
7375
gameDirHelper:
7476
"通常在 Windows 或 Linux 为 '.minecraft' 目录,在 macOS 为 'minecraft' 目录。",
7577
version: "版本",
76-
versionHelper:
77-
"文件夹名称在 'versions' 文件夹在您的游戏目录中。",
78+
versionHelper: "文件夹名称在 'versions' 文件夹在您的游戏目录中。",
7879
unopened: "在左侧选择你曾经举过的例子或者创造一个新的例子。",
7980
removeConfirmation: (name: string) =>
8081
`您真的想要除掉您的举例 ${name} 吗?`,
@@ -105,6 +106,14 @@ export default {
105106
githubHomepage: "版本控制系统枢纽 首页",
106107
downloadProvider: "向下加载提供商",
107108
oss: "开放源代码软件",
109+
theme: "主旋律",
110+
os: "运转制度",
111+
themes: {
112+
followOs: "跟踪运转制度",
113+
light: "光线",
114+
dark: "黑暗",
115+
},
116+
autoCollapse: "自动崩溃的一旁的酒吧",
108117
},
109118
toast: {
110119
copied: "复制是成功的。",

src/pages/instances/VersionDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function VersionDetail(props: {
6565
<div className="flex space-x-3 justify-end">
6666
<Button onClick={browse}>{t.browse}</Button>
6767
<Button disabled={!!helper} onClick={install} primary>
68-
Install
68+
{t.install}
6969
</Button>
7070
</div>
7171
<Shallow className="text-sm font-medium">{helper}</Shallow>

src/pages/settings/AboutFragment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function AboutFragment() {
1313
<MdWarning className="text-xl text-red-500 dark:text-red-300" />
1414
<pre className="text-sm">{t.settings.warning}</pre>
1515
</div>
16-
<Info name="Operating System">
16+
<Info name={t.settings.os}>
1717
{meta.osPlatform}-{meta.osVersion}
1818
</Info>
1919
<Info name={t.settings.tauriVersion}>{meta.tauriVersion}</Info>

src/pages/settings/AppearanceFragment.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ import Info from "../../components/Info";
33
import Select from "../../components/Select";
44
import { cfg } from "../../stores/config";
55
import { Theme, themeStore } from "../../stores/theme";
6+
import { t } from "../../intl";
67

78
export default function AppearanceFragment() {
89
const [theme, setTheme] = useState(cfg.theme);
910

1011
return (
1112
<div className="p-3">
12-
<Info name="Color Theme">
13+
<Info name={t.settings.theme}>
1314
<Select
14-
options={{ follow: "Follow OS", light: "Light", dark: "Dark" }}
15+
options={{
16+
follow: t.settings.themes.followOs,
17+
light: t.settings.themes.light,
18+
dark: t.settings.themes.dark,
19+
}}
1520
value={theme}
1621
onChange={(newValue) => {
17-
setTheme(newValue as Theme);
1822
themeStore.updateTheme(newValue as Theme);
23+
setTheme(newValue as Theme);
1924
}}
2025
/>
2126
</Info>

src/pages/settings/DownloadFragment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function DownloadFragment() {
1313
onChange={(newValue) => {
1414
cfg.downloadProvider = newValue as MinecraftDownloadProvider;
1515
}}
16-
options={{ official: "Official", bmclapi: "BMCLAPI", mcbbs: "MCBBS" }}
16+
options={{ official: t.official, bmclapi: "BMCLAPI", mcbbs: "MCBBS" }}
1717
></Select>
1818
</Info>
1919
</div>

src/pages/settings/GeneralFragment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function GeneralFragment() {
2626
cfg.autoCollapse = newValue;
2727
}}
2828
>
29-
Automatically Collapse Sidebar
29+
{t.settings.autoCollapse}
3030
</Checkbox>
3131
</div>
3232
);

src/stores/theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ThemeStore {
1717
}
1818
updateTheme(theme: Theme) {
1919
this.theme = theme;
20+
cfg.theme = theme;
2021
this.loadTheme();
2122
}
2223
}

0 commit comments

Comments
 (0)