react-native-raw-bottom-sheet icon indicating copy to clipboard operation
react-native-raw-bottom-sheet copied to clipboard

How to add a custom icon to draggableIcon?

Open dhuber666 opened this issue 4 years ago • 2 comments

Hiho,

first and foremost, awesome project!

Is there a way to define my own draggable Icon on the Sheet? Something so it looks like this:

mystyle

This would be the last piece, so I can start to build. If it's not already in there somehow, I might try to implement it and send in a pull request.

Greets from Austria, Geralt

dhuber666 avatar Apr 07 '20 12:04 dhuber666

go to folder node_modules > react-native-raw-bottom-sheet > src > index.js

find and replace this code

{closeOnDragDown && (
    <View
      {...dragFromTopOnly && this.panResponder.panHandlers}
      style={styles.draggableContainer}
    >
          {this.props.customDraggableIcon}
           {/* <View style={[styles.draggableIcon, customStyles.draggableIcon]} /> */}
           </View>
 )}

then use it like this in a prop

<ActionSheet customDraggableIcon={<Text>Your Custom Draggable Icon</Text>} />

alz10 avatar Jun 05 '20 15:06 alz10

You can apply transparent background to the draggle icon and absolutely position your icon in the sheet.

draggableIcon: { backgroundColor: 'transparent', height: 30, width: '100%', },

NitishQuovantis avatar Nov 09 '20 03:11 NitishQuovantis