Skip to content

Commit

Permalink
fix: fix isRTL check in drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Aug 7, 2022
1 parent 8ed42cd commit 2d2f4e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/drawer/src/views/modern/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export default function Drawer({
return translateX;
});

const isRTL = I18nManager.getConstants().isRTL;
const drawerAnimatedStyle = useAnimatedStyle(() => {
const distanceFromEdge = dimensions.width - drawerWidth;

Expand All @@ -273,10 +274,10 @@ export default function Drawer({
// The drawer stays in place when `drawerType` is `back`
(drawerType === 'back' ? 0 : translateX.value) +
(drawerPosition === 'left'
? I18nManager.getConstants().isRTL
? isRTL
? -distanceFromEdge
: 0
: I18nManager.getConstants().isRTL
: isRTL
? 0
: distanceFromEdge),
},
Expand Down

0 comments on commit 2d2f4e3

Please sign in to comment.