[Refactor] (Huge Refactoring 2)
Consolidated all logic into category-specific files. Renamed useTranslation from react-i18next to useI18n to avoid a name conflict with our own function.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import clsx from "clsx";
|
||||
import styles from "./UpdateModal.module.scss";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useI18n } from "@useI18n";
|
||||
import { useStore_OpenedQuickSetting } from "@store";
|
||||
import { usePlugins } from "@logics_configs";
|
||||
import {
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { PluginCompatibilityList } from "./plugins_compatibility_list/PluginCompatibilityList";
|
||||
|
||||
export const UpdateModal = () => {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useI18n();
|
||||
const { updateOpenedQuickSetting } = useStore_OpenedQuickSetting();
|
||||
const { updateSoftware, updateSoftware_CUDA } = useUpdateSoftware();
|
||||
const { updateIsSoftwareUpdating } = useIsSoftwareUpdating();
|
||||
@@ -91,7 +91,7 @@ const VersionDescComponent = (props) => {
|
||||
};
|
||||
|
||||
const CurrentVersionLabel = (props) => {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useI18n();
|
||||
|
||||
if (props.is_latest_version_already) {
|
||||
return <p className={clsx(styles.current_version_label, {[styles.is_cuda]: props.is_cuda})}>{t("update_modal.is_latest_version_already")}</p>;
|
||||
|
||||
@@ -3,13 +3,13 @@ import vrct_logo_for_dark_mode from "@images/vrct_logo_for_dark_mode.png";
|
||||
import vrct_now_downloading from "@images/VRCT_now_downloading.png";
|
||||
|
||||
import {
|
||||
useCTranslate2WeightTypeStatus,
|
||||
useWhisperWeightTypeStatus,
|
||||
useTranslation,
|
||||
useTranscription,
|
||||
} from "@logics_configs";
|
||||
|
||||
export const DownloadModelsContainer = () => {
|
||||
const { currentCTranslate2WeightTypeStatus } = useCTranslate2WeightTypeStatus();
|
||||
const { currentWhisperWeightTypeStatus } = useWhisperWeightTypeStatus();
|
||||
const { currentCTranslate2WeightTypeStatus } = useTranslation();
|
||||
const { currentWhisperWeightTypeStatus } = useTranscription();
|
||||
|
||||
const c_translate_2 = currentCTranslate2WeightTypeStatus.data.find(d => d.id === "small");
|
||||
const whisper = currentWhisperWeightTypeStatus.data.find(d => d.id === "base");
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import styles from "./UpdatingComponent.module.scss";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useI18n } from "@useI18n";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import chat_white_square from "@images/chato_white_square.png";
|
||||
|
||||
export const UpdatingComponent = () => {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useI18n();
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
|
||||
Reference in New Issue
Block a user