rtl-fix address issues

This commit is contained in:
tasnim 2024-08-05 11:31:11 +03:00
parent 048704f572
commit 94a076c9bc
3 changed files with 4 additions and 4 deletions

View File

@ -1385,7 +1385,7 @@ export default function ControlPanel({
<Divider layout="vertical" margin="8px" /> <Divider layout="vertical" margin="8px" />
<Dropdown <Dropdown
style={{ width: "240px" }} style={{ width: "240px" }}
position="bottomLeft" position={isRtl(i18n.language) ? "bottomRight" : "bottomLeft"}
render={ render={
<Dropdown.Menu <Dropdown.Menu
style={isRtl(i18n.language) ? { direction: "rtl" } : {}} style={isRtl(i18n.language) ? { direction: "rtl" } : {}}

View File

@ -63,6 +63,7 @@ export default function TableInfo({ data }) {
<div <div
key={"field_" + j} key={"field_" + j}
className={`cursor-pointer ${drag.draggingOverIndexList.includes(j) ? "opacity-25" : ""}`} className={`cursor-pointer ${drag.draggingOverIndexList.includes(j) ? "opacity-25" : ""}`}
style={{ direction: "ltr" }}
draggable draggable
onDragStart={() => { onDragStart={() => {
setDrag((prev) => ({ ...prev, draggingElementIndex: j })); setDrag((prev) => ({ ...prev, draggingElementIndex: j }));

View File

@ -23,7 +23,6 @@ import { Modal } from "@douyinfe/semi-ui";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { databases } from "../data/databases"; import { databases } from "../data/databases";
import { isRtl } from "../i18n/utils/rtl"; import { isRtl } from "../i18n/utils/rtl";
import i18n from "../i18n/i18n";
export default function WorkSpace() { export default function WorkSpace() {
const [id, setId] = useState(0); const [id, setId] = useState(0);
@ -51,11 +50,11 @@ export default function WorkSpace() {
setDatabase, setDatabase,
} = useDiagram(); } = useDiagram();
const { undoStack, redoStack, setUndoStack, setRedoStack } = useUndoRedo(); const { undoStack, redoStack, setUndoStack, setRedoStack } = useUndoRedo();
const { t } = useTranslation(); const { t, i18n } = useTranslation();
const handleResize = (e) => { const handleResize = (e) => {
if (!resize) return; if (!resize) return;
const w = e.clientX; const w = isRtl(i18n.language) ? window.innerWidth - e.clientX : e.clientX;
if (w > 340) setWidth(w); if (w > 340) setWidth(w);
}; };