From 19ef8d3226714963672697bae91e8b3e27f0a211 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 5 Aug 2024 06:40:42 +0900 Subject: [PATCH] [Update] Config Window: DeeplAuthKey. put edit and save button and move open webpage button to label section. --- .../SettingSection.module.scss | 3 +- .../setting_box/appearance/Appearance.jsx | 5 +- .../deepl_auth_key/DeeplAuthKey.jsx | 42 +++++++++++-- .../deepl_auth_key/DeeplAuthKey.module.scss | 61 ++++++++++++++++++- .../setting_box/components/useSettingBox.jsx | 7 ++- .../components/useSettingBox.module.scss | 12 ++++ 6 files changed, 118 insertions(+), 12 deletions(-) diff --git a/src-ui/windows/config_window/setting_section/SettingSection.module.scss b/src-ui/windows/config_window/setting_section/SettingSection.module.scss index 31ad539b..5b4c76e3 100644 --- a/src-ui/windows/config_window/setting_section/SettingSection.module.scss +++ b/src-ui/windows/config_window/setting_section/SettingSection.module.scss @@ -1,10 +1,9 @@ .scroll_container { width: 100%; - margin-left: 4rem; overflow-y: auto; overflow-x: hidden; } .container { - margin: 4rem; + margin: 6rem 4rem 16rem 3.2rem; } \ No newline at end of file diff --git a/src-ui/windows/config_window/setting_section/setting_box/appearance/Appearance.jsx b/src-ui/windows/config_window/setting_section/setting_box/appearance/Appearance.jsx index dc8ee21a..da04e718 100644 --- a/src-ui/windows/config_window/setting_section/setting_box/appearance/Appearance.jsx +++ b/src-ui/windows/config_window/setting_section/setting_box/appearance/Appearance.jsx @@ -1,6 +1,9 @@ +import { useTranslation } from "react-i18next"; + import { useSettingBox } from "../components/useSettingBox"; import { useSelectedMicDeviceStatus, useMicDeviceListStatus } from "@store"; export const Appearance = () => { + const { t } = useTranslation(); const { currentSelectedMicDeviceStatus, updateSelectedMicDeviceStatus } = useSelectedMicDeviceStatus(); const { currentMicDeviceListStatus } = useMicDeviceListStatus(); const { @@ -40,7 +43,7 @@ export const Appearance = () => { - + ); }; \ No newline at end of file diff --git a/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.jsx b/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.jsx index 7b781178..105c4d7e 100644 --- a/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.jsx +++ b/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.jsx @@ -1,18 +1,52 @@ import styles from "./DeeplAuthKey.module.scss"; +import { useTranslation } from "react-i18next"; import clsx from "clsx"; import ExternalLink from "@images/external_link.svg?react"; import { _Entry } from "../_atoms/_Entry"; +import { useState } from "react"; export const DeeplAuthKey = () => { + const { t } = useTranslation(); + const [is_editable, seIsEditable] = useState(false); + const [input_value, seInputValue] = useState(""); + + const revealEditAuthKey = () => { + seIsEditable(true); + }; + + + const onchangeEntryAuthKey = (e) => { + seInputValue(e.target.value); + }; + const saveAuthKey = () => { + console.log(input_value); + }; return (
- <_Entry width="34rem"/> -
-

Open DeepL Account Webpage

- +
+ <_Entry width="32rem" onChange={onchangeEntryAuthKey}/> + + {is_editable + ? null + : +
+ +
+ }
); +}; + +export const OpenWebpage_DeeplAuthKey = () => { + return ( +
+ +

Open DeepL Account Webpage

+ +
+
+ ); }; \ No newline at end of file diff --git a/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.module.scss b/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.module.scss index 6980d6f4..3880519b 100644 --- a/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.module.scss +++ b/src-ui/windows/config_window/setting_section/setting_box/components/deepl_auth_key/DeeplAuthKey.module.scss @@ -6,8 +6,63 @@ gap: 1rem; } +.entry_section_wrapper { + display: flex; + justify-content: center; + align-items: center; + gap: 1rem; + position: relative; +} + +.entry_edit_cover { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: 0.4rem; + background-color: (#00000044); + backdrop-filter: blur(4rem); + border: solid 0.1rem var(--dark_700_color); + &:hover { + background-color: (#00000088); + } + &:active { + backdrop-filter: blur(1.4rem); + } +} + +.edit_button { + padding: 0.8rem 1.2rem; + color: var(--dark_basic_text_color); + height: 100%; + width: 100%; + font-size: 1.4rem; + text-align: center; +} + +.save_button { + padding: 0.8rem 1.2rem; + background-color: var(--primary_600_color); + color: var(--dark_basic_text_color); + font-size: 1.4rem; + border-radius: 0.4rem; + &:hover { + background-color: var(--primary_500_color); + } + &:active { + background-color: var(--primary_700_color); + } +} + +.open_webpage_button_wrapper { + display: flex; + justify-content: center; + align-items: center; +} + .open_webpage_button { - padding: 0.6rem 1.2rem; + padding: 0.6rem 3.2rem; display: flex; gap: 1rem; justify-content: center; @@ -23,11 +78,11 @@ } .open_webpage_text { - font-size: 1.4rem; + font-size: 1.2rem; color: var(--dark_basic_text_color); } .external_link_svg { color: var(--dark_500_color); - width: 1.8rem; + width: 1.6rem; } \ No newline at end of file diff --git a/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.jsx b/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.jsx index e5adcc35..61e6e56a 100644 --- a/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.jsx +++ b/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.jsx @@ -9,7 +9,7 @@ import { Switchbox } from "./switchbox/Switchbox"; import { Entry } from "./entry/Entry"; import { ThresholdComponent } from "./threshold_component/ThresholdComponent"; import { RadioButton } from "./radio_button/RadioButton"; -import { DeeplAuthKey } from "./deepl_auth_key/DeeplAuthKey"; +import { OpenWebpage_DeeplAuthKey, DeeplAuthKey } from "./deepl_auth_key/DeeplAuthKey"; export const useSettingBox = () => { const { updateIsOpenedDropdownMenu } = useIsOpenedDropdownMenu(); @@ -89,7 +89,10 @@ export const useSettingBox = () => { const DeeplAuthKeyContainer = (props) => { return (
- +
+ + +
); diff --git a/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.module.scss b/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.module.scss index aebb8971..9ab576b6 100644 --- a/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.module.scss +++ b/src-ui/windows/config_window/setting_section/setting_box/components/useSettingBox.module.scss @@ -5,6 +5,9 @@ align-items: center; background-color: var(--dark_888_color); padding: 2rem; + display: flex; + justify-content: space-between; + align-items: center; } .threshold_container { @@ -27,4 +30,13 @@ .threshold_section { width: 100%; +} + +.deepl_auth_key_label_section { + max-width: 34rem; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + gap: 1.4rem; } \ No newline at end of file