[Refactor] Integrate DeepL authentication key URL and enhance OpenWebpage_DeeplAuthKey component to accept props.

This commit is contained in:
Sakamoto Shiina
2025-11-13 12:01:32 +09:00
parent d6498a78ca
commit ddcf49e243
4 changed files with 12 additions and 5 deletions

View File

@@ -128,5 +128,9 @@ export const whisper_weight_type_status = [
{ id: "large-v3-turbo", capacity: "1.58GB"}, { id: "large-v3-turbo", capacity: "1.58GB"},
].map(item => ({ ...item, is_downloaded: false, progress: null })); ].map(item => ({ ...item, is_downloaded: false, progress: null }));
export const deepl_auth_key_url = "https://www.deepl.com/ja/your-account/keys";
export const supporters_data_url = "https://shiinasakamoto.github.io/vrct_supporters/assets/supporters/data.json"; export const supporters_data_url = "https://shiinasakamoto.github.io/vrct_supporters/assets/supporters/data.json";
export const supporters_images_url = "https://ShiinaSakamoto.github.io/vrct_supporters/assets/supporters"; export const supporters_images_url = "https://ShiinaSakamoto.github.io/vrct_supporters/assets/supporters";

View File

@@ -59,12 +59,11 @@ export const DeeplAuthKey = (props) => {
}; };
export const OpenWebpage_DeeplAuthKey = () => { export const OpenWebpage_DeeplAuthKey = (props) => {
const { t } = useI18n();
return ( return (
<div className={styles.open_webpage_button_wrapper}> <div className={styles.open_webpage_button_wrapper}>
<a className={styles.open_webpage_button} href="https://www.deepl.com/ja/your-account/keys" target="_blank" rel="noreferrer" > <a className={styles.open_webpage_button} href={props.webpage_url} target="_blank" rel="noreferrer" >
<p className={styles.open_webpage_text}>{t("config_page.translation.deepl_auth_key.open_auth_key_webpage")}</p> <p className={styles.open_webpage_text}>{props.open_webpage_label}</p>
<ExternalLink className={styles.external_link_svg} /> <ExternalLink className={styles.external_link_svg} />
</a> </a>
</div> </div>

View File

@@ -148,7 +148,7 @@ export const DeeplAuthKeyContainer = (props) => {
<TemplatesContainerWrapper> <TemplatesContainerWrapper>
<div className={styles.deepl_auth_key_label_section}> <div className={styles.deepl_auth_key_label_section}>
<LabelComponent label={props.label} desc={props.desc} /> <LabelComponent label={props.label} desc={props.desc} />
<OpenWebpage_DeeplAuthKey /> <OpenWebpage_DeeplAuthKey {...props} />
</div> </div>
<DeeplAuthKey {...props} /> <DeeplAuthKey {...props} />
</TemplatesContainerWrapper> </TemplatesContainerWrapper>

View File

@@ -22,6 +22,8 @@ import {
LabelComponent, LabelComponent,
} from "../_components"; } from "../_components";
import { deepl_auth_key_url } from "@ui_configs";
export const Translation = () => { export const Translation = () => {
return ( return (
<> <>
@@ -230,6 +232,8 @@ const DeeplAuthKey_Box = () => {
"config_page.translation.deepl_auth_key.desc", "config_page.translation.deepl_auth_key.desc",
{translator: t("main_page.translator")} {translator: t("main_page.translator")}
)} )}
webpage_url={deepl_auth_key_url}
open_webpage_label={t("config_page.translation.deepl_auth_key.open_auth_key_webpage")}
variable={input_value} variable={input_value}
state={currentDeepLAuthKey.state} state={currentDeepLAuthKey.state}
onChangeFunction={onChangeFunction} onChangeFunction={onChangeFunction}