fix: transbox ui

This commit is contained in:
Gabe Yuan
2024-04-16 15:22:27 +08:00
parent ca84bdb227
commit b416e72820
2 changed files with 39 additions and 39 deletions

View File

@@ -32,44 +32,46 @@ function Header({
setHideClickAway, setHideClickAway,
}) { }) {
return ( return (
<Stack direction="row" justifyContent="space-between" alignItems="center"> <Box>
<DragIndicatorIcon fontSize="small" /> <Stack direction="row" justifyContent="space-between" alignItems="center">
<DragIndicatorIcon fontSize="small" />
<Stack direction="row" alignItems="center"> <Stack direction="row" alignItems="center">
<IconButton <IconButton
size="small" size="small"
onClick={() => { onClick={() => {
setHideClickAway((pre) => !pre); setHideClickAway((pre) => !pre);
}} }}
> >
{hideClickAway ? ( {hideClickAway ? (
<PushPinOutlinedIcon fontSize="small" /> <PushPinOutlinedIcon fontSize="small" />
) : ( ) : (
<PushPinIcon fontSize="small" /> <PushPinIcon fontSize="small" />
)} )}
</IconButton> </IconButton>
<IconButton <IconButton
size="small" size="small"
onClick={() => { onClick={() => {
setSimpleStyle((pre) => !pre); setSimpleStyle((pre) => !pre);
}} }}
> >
{simpleStyle ? ( {simpleStyle ? (
<UnfoldMoreIcon fontSize="small" /> <UnfoldMoreIcon fontSize="small" />
) : ( ) : (
<UnfoldLessIcon fontSize="small" /> <UnfoldLessIcon fontSize="small" />
)} )}
</IconButton> </IconButton>
<IconButton <IconButton
size="small" size="small"
onClick={() => { onClick={() => {
setShowPopup(false); setShowPopup(false);
}} }}
> >
<CloseIcon fontSize="small" /> <CloseIcon fontSize="small" />
</IconButton> </IconButton>
</Stack>
</Stack> </Stack>
</Stack> <Divider />
</Box>
); );
} }
@@ -253,7 +255,6 @@ export default function TranBox({
onChangePosition={setBoxPosition} onChangePosition={setBoxPosition}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<Divider />
<TranForm <TranForm
text={text} text={text}
setText={setText} setText={setText}

View File

@@ -103,7 +103,6 @@ export default function Slection({
const { clientX, clientY } = isMobile ? e.changedTouches[0] : e; const { clientX, clientY } = isMobile ? e.changedTouches[0] : e;
setShowBtn(!hideTranBtn); setShowBtn(!hideTranBtn);
// setPosition({ x: e.clientX, y: e.clientY });
setPosition({ x: clientX, y: clientY }); setPosition({ x: clientX, y: clientY });
} }