mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-28 10:33:23 +08:00
chore: remove locale switch
This commit is contained in:
@ -9,7 +9,6 @@ import Tooltip from "./kit/Tooltip";
|
|||||||
import Dropdown, { DropdownItem } from "./kit/Dropdown";
|
import Dropdown, { DropdownItem } from "./kit/Dropdown";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import EngineIcon from "./EngineIcon";
|
import EngineIcon from "./EngineIcon";
|
||||||
import LocaleSwitch from "./LocaleSwitch";
|
|
||||||
import DarkModeSwitch from "./DarkModeSwitch";
|
import DarkModeSwitch from "./DarkModeSwitch";
|
||||||
import CreateConnectionModal from "./CreateConnectionModal";
|
import CreateConnectionModal from "./CreateConnectionModal";
|
||||||
import SettingModal from "./SettingModal";
|
import SettingModal from "./SettingModal";
|
||||||
@ -206,7 +205,6 @@ const ConnectionSidebar = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="w-full flex flex-col justify-end items-center">
|
<div className="w-full flex flex-col justify-end items-center">
|
||||||
<DarkModeSwitch />
|
<DarkModeSwitch />
|
||||||
<LocaleSwitch />
|
|
||||||
<Tooltip title={t("common.setting")} side="right">
|
<Tooltip title={t("common.setting")} side="right">
|
||||||
<button
|
<button
|
||||||
className=" w-10 h-10 p-1 rounded-full flex flex-row justify-center items-center hover:bg-gray-100 dark:hover:bg-zinc-700"
|
className=" w-10 h-10 p-1 rounded-full flex flex-row justify-center items-center hover:bg-gray-100 dark:hover:bg-zinc-700"
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
import { useSettingStore } from "@/store";
|
|
||||||
import Icon from "./Icon";
|
|
||||||
|
|
||||||
const LocaleSwitch = () => {
|
|
||||||
const settingStore = useSettingStore();
|
|
||||||
const locale = settingStore.setting.locale;
|
|
||||||
|
|
||||||
const handleLocaleChange = () => {
|
|
||||||
if (locale === "en") {
|
|
||||||
settingStore.setLocale("zh");
|
|
||||||
} else if (locale === "zh") {
|
|
||||||
settingStore.setLocale("es");
|
|
||||||
} else if (locale === "es") {
|
|
||||||
settingStore.setLocale("jp");
|
|
||||||
} else if (locale === "jp") {
|
|
||||||
settingStore.setLocale("de");
|
|
||||||
} else {
|
|
||||||
settingStore.setLocale("en");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
className="w-10 h-10 p-1 rounded-full flex flex-row justify-center items-center hover:bg-gray-100 dark:hover:bg-zinc-700"
|
|
||||||
onClick={handleLocaleChange}
|
|
||||||
>
|
|
||||||
<Icon.IoLanguage className="text-gray-600 dark:text-gray-300 w-6 h-auto" />
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default LocaleSwitch;
|
|
Reference in New Issue
Block a user