perf: merge Translate Popup/Selected shortcut
This commit is contained in:
@@ -3,12 +3,7 @@ import Stack from "@mui/material/Stack";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import { useI18n } from "../../hooks/I18n";
|
||||
import {
|
||||
OPT_TRANS_ALL,
|
||||
OPT_LANGS_FROM,
|
||||
OPT_LANGS_TO,
|
||||
DEFAULT_TRANSEL_SHORTCUT,
|
||||
} from "../../config";
|
||||
import { OPT_TRANS_ALL, OPT_LANGS_FROM, OPT_LANGS_TO } from "../../config";
|
||||
import ShortcutInput from "./ShortcutInput";
|
||||
import FormControlLabel from "@mui/material/FormControlLabel";
|
||||
import Switch from "@mui/material/Switch";
|
||||
@@ -44,20 +39,12 @@ export default function Tranbox() {
|
||||
[updateTranbox]
|
||||
);
|
||||
|
||||
const handleShortcutTransel = useCallback(
|
||||
(val) => {
|
||||
updateTranbox({ transelShortcut: val });
|
||||
},
|
||||
[updateTranbox]
|
||||
);
|
||||
|
||||
const {
|
||||
transOpen,
|
||||
translator,
|
||||
fromLang,
|
||||
toLang,
|
||||
tranboxShortcut,
|
||||
transelShortcut = DEFAULT_TRANSEL_SHORTCUT,
|
||||
btnOffsetX,
|
||||
btnOffsetY,
|
||||
hideTranBtn = false,
|
||||
@@ -160,12 +147,6 @@ export default function Tranbox() {
|
||||
onChange={handleShortcutInput}
|
||||
label={i18n("trigger_tranbox_shortcut")}
|
||||
/>
|
||||
|
||||
<ShortcutInput
|
||||
value={transelShortcut}
|
||||
onChange={handleShortcutTransel}
|
||||
label={i18n("trigger_transel_shortcut")}
|
||||
/>
|
||||
</Stack>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user