Skip to content

Commit 64206b0

Browse files
authored
newDrawer - support only rightItems in drawer (#468)
* newDrawer - support only rightItems in drawer * newDrawer - return undefined in case of no leftItem
1 parent 8799d08 commit 64206b0

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/interactableComponents/drawer/newDrawer.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ class NewDrawer extends PureBaseComponent {
128128
// TODO: enable support for rendering more than one left item
129129
renderLeftActions = (progress, dragX) => {
130130
const {leftItem} = this.getThemeProps();
131-
return this.renderActions([leftItem], progress, dragX);
131+
const leftItems = leftItem ? [leftItem] : undefined;
132+
return this.renderActions(leftItems, progress, dragX);
132133
};
133134

134135
renderRightActions = (progress, dragX) => {
@@ -190,10 +191,10 @@ class NewDrawer extends PureBaseComponent {
190191
style={[
191192
styles.actionIcon,
192193
{
193-
width: itemsIconSize,
194-
height: itemsIconSize,
195-
tintColor: itemsTintColor,
196-
opacity,
194+
width: itemsIconSize,
195+
height: itemsIconSize,
196+
tintColor: itemsTintColor,
197+
opacity,
197198
transform: [{scale}]
198199
}
199200
]}
@@ -202,12 +203,12 @@ class NewDrawer extends PureBaseComponent {
202203
{item.text && (
203204
<Animated.Text
204205
style={[
205-
styles.actionText,
206+
styles.actionText,
206207
{
207-
color: itemsTintColor,
208-
opacity,
208+
color: itemsTintColor,
209+
opacity,
209210
transform: [{scale}]
210-
},
211+
},
211212
itemsTextStyle
212213
]}
213214
>

0 commit comments

Comments
 (0)