@@ -85,7 +85,7 @@ class NewDrawer extends PureBaseComponent {
85
85
/**
86
86
* Perform the animation in natively
87
87
*/
88
- useNativeAnimations : PropTypes . bool ,
88
+ useNativeAnimations : PropTypes . bool
89
89
} ;
90
90
91
91
static defaultProps = {
@@ -97,8 +97,10 @@ class NewDrawer extends PureBaseComponent {
97
97
98
98
this . _swipeableRow = React . createRef ( ) ;
99
99
this . animationOptions = { bounciness : props . bounciness || 5 } ;
100
- this . rightActionsContainerStyle = this . getActionsContainerStyle ( Constants . isRTL ? [ props . leftItem ] : props . rightItems ) ;
101
- this . leftActionsContainerStyle = this . getActionsContainerStyle ( Constants . isRTL ? props . rightItems : [ props . leftItem ] ) ;
100
+
101
+ this . rightActionsContainerStyle = this . getRightActionsContainerStyle ( ) ;
102
+ this . leftActionsContainerStyle = this . getLeftActionsContainerStyle ( ) ;
103
+
102
104
this . leftRender = props . leftItem ? ( Constants . isRTL ? this . renderRightActions : this . renderLeftActions ) : undefined ;
103
105
this . rightRender = props . rightItems ? ( Constants . isRTL ? this . renderLeftActions : this . renderRightActions ) : undefined ;
104
106
@@ -119,6 +121,16 @@ class NewDrawer extends PureBaseComponent {
119
121
} ) ;
120
122
}
121
123
124
+ getLeftActionsContainerStyle ( ) {
125
+ const { rightItems, leftItem} = this . getThemeProps ( ) ;
126
+ return this . getActionsContainerStyle ( Constants . isRTL ? rightItems : [ leftItem ] ) ;
127
+ }
128
+
129
+ getRightActionsContainerStyle ( ) {
130
+ const { rightItems, leftItem} = this . getThemeProps ( ) ;
131
+ return this . getActionsContainerStyle ( Constants . isRTL ? [ leftItem ] : rightItems ) ;
132
+ }
133
+
122
134
getActionsContainerStyle ( items ) {
123
135
return { backgroundColor : _ . get ( _ . first ( items ) , 'background' , DEFAULT_BG ) } ;
124
136
}
@@ -137,6 +149,7 @@ class NewDrawer extends PureBaseComponent {
137
149
onSwipeableWillOpen = ( ) => {
138
150
_ . invoke ( this . props , 'onSwipeableWillOpen' , this . props ) ;
139
151
} ;
152
+
140
153
onSwipeableWillClose = ( ) => {
141
154
_ . invoke ( this . props , 'onSwipeableWillClose' , this . props ) ;
142
155
} ;
@@ -237,6 +250,7 @@ class NewDrawer extends PureBaseComponent {
237
250
238
251
render ( ) {
239
252
const { children, style, ...others } = this . props ;
253
+
240
254
return (
241
255
< Swipeable
242
256
{ ...others }
0 commit comments