[Refactor] Change the function names.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useSelectedConfigTabId } from "@store";
|
||||
import { useStore_SelectedConfigTabId } from "@store";
|
||||
|
||||
import { Device } from "./device/Device";
|
||||
import { Appearance } from "./appearance/Appearance";
|
||||
@@ -6,7 +6,7 @@ import { Appearance } from "./appearance/Appearance";
|
||||
// import { AboutVrct } from "./about_vrct/AboutVrct";
|
||||
|
||||
export const SettingBox = () => {
|
||||
const { currentSelectedConfigTabId } = useSelectedConfigTabId();
|
||||
const { currentSelectedConfigTabId } = useStore_SelectedConfigTabId();
|
||||
switch (currentSelectedConfigTabId) {
|
||||
case "device":
|
||||
return <Device />;
|
||||
|
||||
@@ -19,12 +19,12 @@ import vrchat_disclaimer from "@images/about_vrct/vrchat_disclaimer.png";
|
||||
|
||||
import clsx from "clsx";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useUiLanguageStatus } from "@store";
|
||||
import { useStore_UiLanguage } from "@store";
|
||||
import { PosterShowcaseContents } from "./poster_showcase_contents/PosterShowcaseContents";
|
||||
|
||||
export const AboutVrct = () => {
|
||||
const { t } = useTranslation();
|
||||
const { currentUiLanguageStatus } = useUiLanguageStatus();
|
||||
const { currentUiLanguage } = useStore_UiLanguage();
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.dev_section}>
|
||||
@@ -74,7 +74,7 @@ export const AboutVrct = () => {
|
||||
<img src={special_thanks_section_title} className={clsx(styles.section_title, styles.special_thanks)} />
|
||||
<img src={special_thanks_members} className={styles.special_thanks_members_img} />
|
||||
{
|
||||
currentUiLanguageStatus === "ja"
|
||||
currentUiLanguage === "ja"
|
||||
? <img src={special_thanks_message_ja} className={styles.special_thanks_message_img} />
|
||||
: <img src={special_thanks_message_en} className={styles.special_thanks_message_img} />
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import clsx from "clsx";
|
||||
import styles from "./PosterShowcaseWorldsContents.module.scss";
|
||||
import { usePosterShowcaseWorldPageIndex } from "@store";
|
||||
import { useStore_PosterShowcaseWorldPageIndex } from "@store";
|
||||
const images = import.meta.glob("@images/about_vrct/showcased_worlds/*.{png,jpg,jpeg,svg}", { eager: true });
|
||||
|
||||
const getImageByFileName = (file_name) => {
|
||||
@@ -12,7 +12,7 @@ import poster_showcase_worlds_settings from "./poster_showcase_worlds_settings";
|
||||
import { chunkArray } from "@utils/chunkArray";
|
||||
|
||||
export const PosterShowcaseWorldsContents = () => {
|
||||
const { currentPosterShowcaseWorldPageIndex } = usePosterShowcaseWorldPageIndex();
|
||||
const { currentPosterShowcaseWorldPageIndex } = useStore_PosterShowcaseWorldPageIndex();
|
||||
const poster_showcase_world_images = poster_showcase_worlds_settings.map((setting) => ({
|
||||
img: getImageByFileName(setting.image_file_name),
|
||||
x_post_num: setting.x_post_num
|
||||
@@ -59,7 +59,7 @@ import chat_white_square from "@images/chato_white_square.png";
|
||||
import { useEffect } from "react";
|
||||
import { randomIntMinMax } from "@utils/randomIntMinMax";
|
||||
const PosterShowcaseWorldsPagination = ({ page_length }) => {
|
||||
const { currentPosterShowcaseWorldPageIndex, updatePosterShowcaseWorldPageIndex } = usePosterShowcaseWorldPageIndex();
|
||||
const { currentPosterShowcaseWorldPageIndex, updatePosterShowcaseWorldPageIndex } = useStore_PosterShowcaseWorldPageIndex();
|
||||
|
||||
useEffect(() => {
|
||||
updatePosterShowcaseWorldPageIndex(randomIntMinMax(page_length -1));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import clsx from "clsx";
|
||||
import styles from "./PostersContents.module.scss";
|
||||
import { useUiLanguageStatus } from "@store";
|
||||
import { useStore_UiLanguage } from "@store";
|
||||
|
||||
import { useVrctPosterIndex } from "@store";
|
||||
import { useStore_VrctPosterIndex } from "@store";
|
||||
import ArrowLeftSvg from "@images/arrow_left.svg?react";
|
||||
|
||||
import iya_vrct_poster_ja from "@images/about_vrct/vrct_posters/iya_vrct_poster_ja.png";
|
||||
@@ -29,8 +29,8 @@ import poster_images_authors_m_ja from "@images/about_vrct/vrct_posters/authors/
|
||||
import poster_images_authors_m_en from "@images/about_vrct/vrct_posters/authors/poster_images_authors_m_en.png";
|
||||
|
||||
export const PostersContents = () => {
|
||||
const { currentVrctPosterIndex, updateVrctPosterIndex } = useVrctPosterIndex();
|
||||
const { currentUiLanguageStatus } = useUiLanguageStatus();
|
||||
const { currentVrctPosterIndex, updateVrctPosterIndex } = useStore_VrctPosterIndex();
|
||||
const { currentUiLanguage } = useStore_UiLanguage();
|
||||
|
||||
|
||||
const updateIndex = (delta) => {
|
||||
@@ -60,7 +60,7 @@ export const PostersContents = () => {
|
||||
</button>
|
||||
</div>
|
||||
{
|
||||
currentUiLanguageStatus === "ja"
|
||||
currentUiLanguage === "ja"
|
||||
? <img src={current_poster_authors_img_ja} className={styles.poster_authors_img} />
|
||||
: <img src={current_poster_authors_img_en} className={styles.poster_authors_img} />
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ import { useTranslation } from "react-i18next";
|
||||
import FolderOpenSvg from "@images/folder_open.svg?react";
|
||||
|
||||
import { useSettingBox } from "../components/useSettingBox";
|
||||
import { useSelectedMicDevice, useMicDeviceList } from "@store";
|
||||
import { useStore_SelectedMicDevice, useStore_MicDeviceList } from "@store";
|
||||
export const Appearance = () => {
|
||||
const { t } = useTranslation();
|
||||
const { currentSelectedMicDevice, updateSelectedMicDevice } = useSelectedMicDevice();
|
||||
const { currentMicDeviceList } = useMicDeviceList();
|
||||
const { currentSelectedMicDevice, updateSelectedMicDevice } = useStore_SelectedMicDevice();
|
||||
const { currentMicDeviceList } = useStore_MicDeviceList();
|
||||
const {
|
||||
DropdownMenuContainer,
|
||||
SliderContainer,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import styles from "./DropdownMenu.module.scss";
|
||||
import clsx from "clsx";
|
||||
import ArrowLeftSvg from "@images/arrow_left.svg?react";
|
||||
import { useIsOpenedDropdownMenu } from "@store";
|
||||
import { useStore_IsOpenedDropdownMenu } from "@store";
|
||||
|
||||
export const DropdownMenu = (props) => {
|
||||
const { updateIsOpenedDropdownMenu, currentIsOpenedDropdownMenu } = useIsOpenedDropdownMenu();
|
||||
const { updateIsOpenedDropdownMenu, currentIsOpenedDropdownMenu } = useStore_IsOpenedDropdownMenu();
|
||||
|
||||
const toggleDropdownMenu = () => {
|
||||
if (currentIsOpenedDropdownMenu === props.dropdown_id) {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import styles from "./MessageFormat.module.scss";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
useUiLanguageStatus,
|
||||
useSendMessageFormat,
|
||||
useSendMessageFormatWithT,
|
||||
useReceivedMessageFormat,
|
||||
useReceivedMessageFormatWithT,
|
||||
useStore_UiLanguage,
|
||||
useStore_SendMessageFormat,
|
||||
useStore_SendMessageFormatWithT,
|
||||
useStore_ReceivedMessageFormat,
|
||||
useStore_ReceivedMessageFormatWithT,
|
||||
} from "@store";
|
||||
import { _Entry } from "../_atoms/_entry/_Entry";
|
||||
import SwapImg from "@images/swap_icon.png";
|
||||
|
||||
export const MessageFormat = (props) => {
|
||||
const { currentSendMessageFormat, updateSendMessageFormat } = useSendMessageFormat();
|
||||
const { currentSendMessageFormatWithT, updateSendMessageFormatWithT } = useSendMessageFormatWithT();
|
||||
const { currentReceivedMessageFormat, updateReceivedMessageFormat } = useReceivedMessageFormat();
|
||||
const { currentReceivedMessageFormatWithT, updateReceivedMessageFormatWithT } = useReceivedMessageFormatWithT();
|
||||
const { currentSendMessageFormat, updateSendMessageFormat } = useStore_SendMessageFormat();
|
||||
const { currentSendMessageFormatWithT, updateSendMessageFormatWithT } = useStore_SendMessageFormatWithT();
|
||||
const { currentReceivedMessageFormat, updateReceivedMessageFormat } = useStore_ReceivedMessageFormat();
|
||||
const { currentReceivedMessageFormatWithT, updateReceivedMessageFormatWithT } = useStore_ReceivedMessageFormatWithT();
|
||||
|
||||
let atoms = [];
|
||||
switch (props.id) {
|
||||
@@ -49,14 +49,14 @@ export const MessageFormat = (props) => {
|
||||
|
||||
const ExampleComponent = ({ id, current_format }) => {
|
||||
const { t } = useTranslation();
|
||||
const { currentUiLanguageStatus } = useUiLanguageStatus();
|
||||
const { currentUiLanguage } = useStore_UiLanguage();
|
||||
|
||||
const createExampleMessage = () => {
|
||||
const originalLangMessage = t("config_page.send_message_format.example_text");
|
||||
let format = current_format;
|
||||
|
||||
if (["send_with_t", "received_with_t"].includes(id)) {
|
||||
const translationLocale = currentUiLanguageStatus === "en" ? "ja" : "en";
|
||||
const translationLocale = currentUiLanguage === "en" ? "ja" : "en";
|
||||
const translatedLangMessage = t("config_page.send_message_format.example_text", { lng: translationLocale });
|
||||
|
||||
return format.is_message_first
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useState } from "react";
|
||||
import styles from "./SliderAndMeter.module.scss";
|
||||
import {
|
||||
useMicVolume,
|
||||
useSpeakerVolume,
|
||||
useStore_MicVolume,
|
||||
useStore_SpeakerVolume,
|
||||
} from "@store";
|
||||
|
||||
import { useVolume } from "@logics/useVolume";
|
||||
@@ -23,7 +23,7 @@ export const SliderAndMeter = (props) => {
|
||||
|
||||
|
||||
const ThresholdVolumeMeter_Mic = (props) => {
|
||||
const { currentMicVolume } = useMicVolume();
|
||||
const { currentMicVolume } = useStore_MicVolume();
|
||||
|
||||
const currentVolumeVariable = Math.min(currentMicVolume.data, props.max);
|
||||
const volume_width_percentage = (currentVolumeVariable / props.max) * 100;
|
||||
@@ -46,7 +46,7 @@ const ThresholdVolumeMeter_Mic = (props) => {
|
||||
|
||||
|
||||
const ThresholdVolumeMeter_Speaker = (props) => {
|
||||
const { currentSpeakerVolume } = useSpeakerVolume();
|
||||
const { currentSpeakerVolume } = useStore_SpeakerVolume();
|
||||
|
||||
const currentVolumeVariable = Math.min(currentSpeakerVolume.data, props.max);
|
||||
const volume_width_percentage = (currentVolumeVariable / props.max) * 100;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import styles from "./useSettingBox.module.scss";
|
||||
import { useIsOpenedDropdownMenu } from "@store";
|
||||
import { useStore_IsOpenedDropdownMenu } from "@store";
|
||||
import clsx from "clsx";
|
||||
|
||||
import { LabelComponent } from "./label_component/LabelComponent";
|
||||
@@ -17,7 +17,7 @@ import { WordFilter, WordFilterListToggleComponent } from "./word_filter/WordFil
|
||||
|
||||
|
||||
const useOnMouseLeaveDropdownMenu = () => {
|
||||
const { updateIsOpenedDropdownMenu } = useIsOpenedDropdownMenu();
|
||||
const { updateIsOpenedDropdownMenu } = useStore_IsOpenedDropdownMenu();
|
||||
|
||||
const onMouseLeaveFunction = () => {
|
||||
updateIsOpenedDropdownMenu("");
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import styles from "./WordFilter.module.scss";
|
||||
import { _Entry } from "../_atoms/_entry/_Entry";
|
||||
import { useState } from "react";
|
||||
import { useWordFilterList, useIsOpenedWordFilterList } from "@store";
|
||||
import { useStore_WordFilterList, useStore_IsOpenedWordFilterList } from "@store";
|
||||
export const WordFilter = () => {
|
||||
const [input_value, setInputValue] = useState();
|
||||
const { currentWordFilterList, updateWordFilterList } = useWordFilterList();
|
||||
const { currentIsOpenedWordFilterList, updateIsOpenedWordFilterList } = useIsOpenedWordFilterList();
|
||||
const { currentWordFilterList, updateWordFilterList } = useStore_WordFilterList();
|
||||
const { currentIsOpenedWordFilterList, updateIsOpenedWordFilterList } = useStore_IsOpenedWordFilterList();
|
||||
|
||||
const onChangeEntry = (e) => {
|
||||
setInputValue(e.target.value);
|
||||
@@ -112,8 +112,8 @@ import { useTranslation } from "react-i18next";
|
||||
import ArrowLeftSvg from "@images/arrow_left.svg?react";
|
||||
export const WordFilterListToggleComponent = (props) => {
|
||||
const { t } = useTranslation();
|
||||
const { currentIsOpenedWordFilterList, updateIsOpenedWordFilterList } = useIsOpenedWordFilterList();
|
||||
const { currentWordFilterList } = useWordFilterList();
|
||||
const { currentIsOpenedWordFilterList, updateIsOpenedWordFilterList } = useStore_IsOpenedWordFilterList();
|
||||
const { currentWordFilterList } = useStore_WordFilterList();
|
||||
|
||||
|
||||
const svg_class_names = clsx(styles["arrow_left_svg"], {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useSettingBox } from "../components/useSettingBox";
|
||||
// import {
|
||||
// useEnableAutoClearMessageBox,
|
||||
// useStore_EnableAutoClearMessageBox,
|
||||
// } from "@store";
|
||||
|
||||
import { useConfig } from "@logics/useConfig";
|
||||
|
||||
Reference in New Issue
Block a user