add color input to popup

This commit is contained in:
Gabe Yuan
2023-08-09 22:58:03 +08:00
parent 7a84933107
commit 077713cd64
2 changed files with 10 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ export default function Action({ translator }) {
const popProps = useMemo(() => {
const width = Math.min(windowSize.w, 300);
const height = Math.min(windowSize.h, 386);
const height = Math.min(windowSize.h, 442);
const left = (windowSize.w - width) / 2;
const top = (windowSize.h - height) / 2;
return {

View File

@@ -89,7 +89,7 @@ export default function Popup({ setShowPopup, translator: tran }) {
);
}
const { transOpen, translator, fromLang, toLang, textStyle } = rule;
const { transOpen, translator, fromLang, toLang, textStyle, bgColor } = rule;
return (
<Box minWidth={300} sx={{ p: 2 }}>
@@ -168,6 +168,14 @@ export default function Popup({ setShowPopup, translator: tran }) {
))}
</TextField>
<TextField
size="small"
name="bgColor"
defaultValue={bgColor}
label={i18n("bg_color")}
onBlur={handleChange}
/>
<Button variant="text" onClick={handleOpenSetting}>
{i18n("setting")}
</Button>