react-native-actions-sheet icon indicating copy to clipboard operation
react-native-actions-sheet copied to clipboard

how to add footer component

Open rawatnaresh opened this issue 3 years ago • 3 comments

I've been testing out this library to see if i can use this in replacement of react-native-bottom-sheet. it has all the features I need but I couldn't find a way to add Footer Component

A use-case for Footer Component would be something like shown in below image

Screen Shot 2022-10-22 at 09 45 58

rawatnaresh avatar Oct 22 '22 04:10 rawatnaresh

If I understand correctly, you can add a component at bottom for footer which should just work unless you are looking for something else?

Just putting a View style={{height:100}} /> creates a footer and you can add anything there like tabs etc?

ammarahm-ed avatar Oct 25 '22 03:10 ammarahm-ed

I have a use-case like this

<ScrollView> ... </ScrollView>
<Footer/>

And, I would like the Footer to always be visible irrespective of the scroll position. Just adding the <Footer/> beneath the ScrollView will not work because it will pushed below the scrollable content and will be visible only if I scroll to the bottom.

rawatnaresh avatar Oct 25 '22 05:10 rawatnaresh

@ammarahm-ed How to pass children to Action sheet?


export default function Drawer({ children }: DrawerProps) {
        ...
	return (
		<ActionSheet
			CustomHeaderComponent={DrawerHeader}
			headerAlwaysVisible={true}
			containerStyle={styles.actionSheetContainer}>
			<View style={styles.contentContainer}>{children}</View>
		</ActionSheet>
	);
}

I was looking for something like this. I have a couple of content views so I thought of creating a single drawer and then passing my content inside of this drawer but it doesn't seem to work like this :(


<Drawer>
    <MyContent />
</Drawer>

jangirritik06 avatar Apr 19 '24 06:04 jangirritik06