[Update] Config Page: Move section Send Message Button Type where others tab to appearance tab.
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
useUiLanguage,
|
||||
useUiScaling,
|
||||
useMessageLogUiScaling,
|
||||
useSendMessageButtonType,
|
||||
useSelectedFontFamily,
|
||||
useTransparency,
|
||||
} from "@logics_configs";
|
||||
@@ -18,6 +19,7 @@ import {
|
||||
import {
|
||||
SliderContainer,
|
||||
DropdownMenuContainer,
|
||||
RadioButtonContainer,
|
||||
} from "../_templates/Templates";
|
||||
|
||||
export const Appearance = () => {
|
||||
@@ -26,6 +28,7 @@ export const Appearance = () => {
|
||||
<UiLanguageContainer />
|
||||
<UiScalingContainer />
|
||||
<MessageLogUiScalingContainer />
|
||||
<SendMessageButtonTypeContainer />
|
||||
<FontFamilyContainer />
|
||||
<TransparencyContainer />
|
||||
</>
|
||||
@@ -157,6 +160,24 @@ const MessageLogUiScalingContainer = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const SendMessageButtonTypeContainer = () => {
|
||||
const { t } = useTranslation();
|
||||
const { currentSendMessageButtonType, setSendMessageButtonType } = useSendMessageButtonType();
|
||||
|
||||
return (
|
||||
<RadioButtonContainer
|
||||
label={t("config_page.send_message_button_type.label")}
|
||||
selectFunction={setSendMessageButtonType}
|
||||
options={[
|
||||
{ radio_button_id: "hide", label: t("config_page.send_message_button_type.hide") },
|
||||
{ radio_button_id: "show", label: t("config_page.send_message_button_type.show") },
|
||||
{ radio_button_id: "show_and_disable_enter_key", label: t("config_page.send_message_button_type.show_and_disable_enter_key") },
|
||||
]}
|
||||
checked_variable={currentSendMessageButtonType}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const FontFamilyContainer = () => {
|
||||
const { t } = useTranslation();
|
||||
const { currentSelectedFontFamily, setSelectedFontFamily } = useSelectedFontFamily();
|
||||
|
||||
@@ -2,12 +2,10 @@ import { useTranslation } from "react-i18next";
|
||||
|
||||
import {
|
||||
useEnableAutoClearMessageInputBox,
|
||||
useSendMessageButtonType,
|
||||
} from "@logics_configs";
|
||||
|
||||
import {
|
||||
CheckboxContainer,
|
||||
RadioButtonContainer,
|
||||
} from "../_templates/Templates";
|
||||
|
||||
|
||||
@@ -15,7 +13,6 @@ export const Others = () => {
|
||||
return (
|
||||
<>
|
||||
<AutoClearMessageInputBoxContainer />
|
||||
<SendMessageButtonTypeContainer />
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -32,21 +29,3 @@ const AutoClearMessageInputBoxContainer = () => {
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const SendMessageButtonTypeContainer = () => {
|
||||
const { t } = useTranslation();
|
||||
const { currentSendMessageButtonType, setSendMessageButtonType } = useSendMessageButtonType();
|
||||
|
||||
return (
|
||||
<RadioButtonContainer
|
||||
label={t("config_page.send_message_button_type.label")}
|
||||
selectFunction={setSendMessageButtonType}
|
||||
options={[
|
||||
{ radio_button_id: "hide", label: t("config_page.send_message_button_type.hide") },
|
||||
{ radio_button_id: "show", label: t("config_page.send_message_button_type.show") },
|
||||
{ radio_button_id: "show_and_disable_enter_key", label: t("config_page.send_message_button_type.show_and_disable_enter_key") },
|
||||
]}
|
||||
checked_variable={currentSendMessageButtonType}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -12,11 +12,11 @@ export { useSpeakerThreshold } from "./device/useSpeakerThreshold";
|
||||
export { useMessageLogUiScaling } from "./appearance/useMessageLogUiScaling";
|
||||
export { useSelectedFontFamily } from "./appearance/useSelectedFontFamily";
|
||||
export { useTransparency } from "./appearance/useTransparency";
|
||||
export { useSendMessageButtonType } from "./others/useSendMessageButtonType";
|
||||
export { useUiLanguage } from "./appearance/useUiLanguage";
|
||||
export { useUiScaling } from "./appearance/useUiScaling";
|
||||
|
||||
export { useEnableAutoClearMessageInputBox } from "./others/useEnableAutoClearMessageInputBox";
|
||||
export { useSendMessageButtonType } from "./others/useSendMessageButtonType";
|
||||
|
||||
export { useMicRecordTimeout } from "./transcription/useMicRecordTimeout";
|
||||
export { useMicPhraseTimeout } from "./transcription/useMicPhraseTimeout";
|
||||
|
||||
@@ -28,11 +28,11 @@ import {
|
||||
useMicThreshold,
|
||||
useSpeakerThreshold,
|
||||
useEnableAutoClearMessageInputBox,
|
||||
useSendMessageButtonType,
|
||||
useSelectedFontFamily,
|
||||
useUiLanguage,
|
||||
useUiScaling,
|
||||
useMessageLogUiScaling,
|
||||
useSendMessageButtonType,
|
||||
useTransparency,
|
||||
useMicRecordTimeout,
|
||||
useMicPhraseTimeout,
|
||||
@@ -237,6 +237,9 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/textbox_ui_scaling": updateMessageLogUiScaling,
|
||||
"/set/data/textbox_ui_scaling": updateMessageLogUiScaling,
|
||||
|
||||
"/get/data/send_message_button_type": updateSendMessageButtonType,
|
||||
"/set/data/send_message_button_type": updateSendMessageButtonType,
|
||||
|
||||
"/get/data/font_family": updateSelectedFontFamily,
|
||||
"/set/data/font_family": updateSelectedFontFamily,
|
||||
|
||||
@@ -295,9 +298,6 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageInputBox,
|
||||
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageInputBox,
|
||||
"/set/disable/auto_clear_message_box": updateEnableAutoClearMessageInputBox,
|
||||
|
||||
"/get/data/send_message_button_type": updateSendMessageButtonType,
|
||||
"/set/data/send_message_button_type": updateSendMessageButtonType,
|
||||
};
|
||||
|
||||
const error_routes = {
|
||||
|
||||
@@ -171,6 +171,7 @@ export const { atomInstance: Atom_EnableAutomaticSpeakerThreshold, useHook: useS
|
||||
export const { atomInstance: Atom_UiLanguage, useHook: useStore_UiLanguage } = createAtomWithHook("en", "UiLanguage");
|
||||
export const { atomInstance: Atom_UiScaling, useHook: useStore_UiScaling } = createAtomWithHook(100, "UiScaling");
|
||||
export const { atomInstance: Atom_MessageLogUiScaling, useHook: useStore_MessageLogUiScaling } = createAtomWithHook(100, "MessageLogUiScaling");
|
||||
export const { atomInstance: Atom_SendMessageButtonType, useHook: useStore_SendMessageButtonType } = createAtomWithHook("show", "SendMessageButtonType");
|
||||
export const { atomInstance: Atom_SelectedFontFamily, useHook: useStore_SelectedFontFamily } = createAtomWithHook("Yu Gothic UI", "SelectedFontFamily");
|
||||
export const { atomInstance: Atom_SelectableFontFamilyList, useHook: useStore_SelectableFontFamilyList } = createAtomWithHook({}, "SelectableFontFamilyList");
|
||||
export const { atomInstance: Atom_Transparency, useHook: useStore_Transparency } = createAtomWithHook(100, "Transparency");
|
||||
@@ -190,8 +191,6 @@ export const { atomInstance: Atom_SpeakerMaxWords, useHook: useStore_SpeakerMaxW
|
||||
|
||||
// Others
|
||||
export const { atomInstance: Atom_EnableAutoClearMessageInputBox, useHook: useStore_EnableAutoClearMessageInputBox } = createAtomWithHook(true, "EnableAutoClearMessageInputBox");
|
||||
export const { atomInstance: Atom_SendMessageButtonType, useHook: useStore_SendMessageButtonType } = createAtomWithHook("show", "SendMessageButtonType");
|
||||
|
||||
|
||||
export const { atomInstance: Atom_IsOpenedTranslatorSelector, useHook: useStore_IsOpenedTranslatorSelector } = createAtomWithHook(false, "IsOpenedTranslatorSelector");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user