Skip to content

Commit d110dc1

Browse files
authored
Polish before release (#108)
1 parent 57293ba commit d110dc1

File tree

6 files changed

+41
-21
lines changed

6 files changed

+41
-21
lines changed

config/example.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
// Hides Bilibili provider. If it is unspecified, `false` will be used
7373
// by default.
7474
"hidden": false,
75-
// Cookie for Bilibili. If it is unspecified, you'll get only 480P when downloading videos.
75+
// The cookie of Bilibili. If it is unspecified, Anioke can onl
76+
// download videos with resolution less than 480p.
7677
"cookie": ""
7778
},
7879
"ncm": {

src/components/SettingsWindow.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,3 @@
1414
.settings-window-form > .ant-form-item {
1515
margin: 0 0 8px;
1616
}
17-
18-
.settings-window-form .ant-form-item-label .icon-info {
19-
margin-left: 4px;
20-
}

src/components/SettingsWindow.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ import {
88
Space,
99
Switch,
1010
Tabs,
11-
Tooltip,
1211
} from "antd";
1312
import React, { useCallback, useEffect, useState } from "react";
1413
import { useTranslation } from "react-i18next";
15-
import InfoCircleOutlined from "@ant-design/icons/InfoCircleOutlined";
1614
import "./SettingsWindow.css";
15+
import TooltipLabel from "./TooltipLabel";
1716
import "./Window.css";
1817

1918
const { TextArea } = Input;
@@ -43,13 +42,6 @@ const SettingsWindow = (props) => {
4342
form.submit();
4443
}, [form]);
4544

46-
const BilibiliCookiesConfigLabel = (
47-
<Tooltip title={t("bilibili_cookies_tooltip")}>
48-
<span>{t("cookie")}</span>
49-
<InfoCircleOutlined className="icon-info" />
50-
</Tooltip>
51-
);
52-
5345
return (
5446
<Space
5547
className={`settings-window-space ${className}`}
@@ -142,10 +134,15 @@ const SettingsWindow = (props) => {
142134
<Switch />
143135
</Form.Item>
144136
<Form.Item
145-
label={BilibiliCookiesConfigLabel}
137+
label={
138+
<TooltipLabel
139+
tooltip={t("bilibili_cookie_tooltip")}
140+
label={t("cookie")}
141+
/>
142+
}
146143
name={["providers", "mv", "bilibili", "cookie"]}
147144
>
148-
<Input />
145+
<Input.Password />
149146
</Form.Item>
150147
<Divider plain orientation="left" style={{ marginTop: 0 }}>
151148
{t("ncm_mv")}
@@ -168,7 +165,12 @@ const SettingsWindow = (props) => {
168165
<Switch />
169166
</Form.Item>
170167
<Form.Item
171-
label={t("api_key")}
168+
label={
169+
<TooltipLabel
170+
tooltip={t("youtube_api_key_tooltip")}
171+
label={t("api_key")}
172+
/>
173+
}
172174
name={["providers", "mv", "youtube", "key"]}
173175
>
174176
<Input.Password />

src/components/TooltipLabel.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.tooltip-label-icon {
2+
margin-left: 4px;
3+
}

src/components/TooltipLabel.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { InfoCircleOutlined } from "@ant-design/icons";
2+
import { Tooltip } from "antd";
3+
import "./TooltipLabel.css";
4+
5+
const TooltipLabel = (props) => {
6+
const { className, tooltip, label } = props;
7+
8+
return (
9+
<Tooltip className={className} title={tooltip}>
10+
<span>{label}</span>
11+
<InfoCircleOutlined className="tooltip-label-icon" />
12+
</Tooltip>
13+
);
14+
};
15+
16+
export default TooltipLabel;

src/locales/zh.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,20 @@ const zh = {
8181
providers: "数据源",
8282
mv: "MV",
8383
bilibili: "哔哩哔哩",
84+
cookie: "Cookie",
85+
bilibili_cookie_tooltip:
86+
"提供哔哩哔哩的 Cookie 后,Anioke 将支持下载分辨率高于 480p 的 MV",
8487
hidden: "隐藏",
8588
ncm_mv: "网易云音乐 (MV)",
8689
youtube: "YouTube",
87-
api_key: "API Key",
90+
api_key: "API 密钥",
91+
youtube_api_key_tooltip:
92+
"提供 YouTube 的 API 密钥 后,Anioke 将支持搜索与下载 MV",
8893
lyrics: "歌词",
8994
joysound: "JOYSOUND",
9095
ncm_lyrics: "网易云音乐 (歌词)",
9196
petit_lyrics: "プチリリ",
9297
save: "保存",
93-
cookie: "Cookie",
94-
bilibili_cookies_tooltip:
95-
"哔哩哔哩需要提供 Cookie 才能获取 480P 以上的画质",
9698
},
9799
};
98100

0 commit comments

Comments
 (0)