Skip to content

Commit

Permalink
fix(antd): rtl support for mobile sider (#6245) (fixes #6263)
Browse files Browse the repository at this point in the history
Co-authored-by: Ali Emir Şen <senaliemir@gmail.com>
  • Loading branch information
youssefsiam38 and aliemir committed Aug 16, 2024
1 parent 743bf3e commit 7ba4ea1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .changeset/friendly-panthers-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@refinedev/antd": patch
---

fix(antd): rtl support for mobile sider trigger and drawer placement

`<ThemedLayoutV2 />` has RTL support but it lacks the mobile sider trigger and drawer placement. This change places the drawer depending on the preferred direction. It also adds RTL support for the styling of the mobile sider trigger.

[Fixes #6263](https://github.com/refinedev/refine/issues/6263)
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
<Drawer
open={mobileSiderOpen}
onClose={() => setMobileSiderOpen(false)}
placement="left"
placement={direction === "rtl" ? "right" : "left"}
closable={false}
width={200}
bodyStyle={{
Expand Down
4 changes: 2 additions & 2 deletions packages/antd/src/components/themedLayoutV2/sider/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { CSSProperties } from "react";

export const drawerButtonStyles: CSSProperties = {
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
borderStartStartRadius: 0,
borderEndStartRadius: 0,
position: "fixed",
top: 64,
zIndex: 999,
Expand Down

0 comments on commit 7ba4ea1

Please sign in to comment.