-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced react-native-actionsheet with react-native-modal implementation
Signed-off-by: sarthakpranesh <[email protected]>
- Loading branch information
sarthakpranesh
committed
Sep 2, 2020
1 parent
c4a5b42
commit 154c05e
Showing
10 changed files
with
264 additions
and
218 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React from 'react'; | ||
import {StyleSheet, Text, View} from 'react-native'; | ||
import {Button, Divider, DarkTheme} from 'react-native-paper'; | ||
import Modal from 'react-native-modal'; | ||
|
||
// importing Styles | ||
import Styles from '../../Styles.js'; | ||
|
||
const BottomSheet = ({isOpen, closeBottomSheet, options}) => { | ||
return ( | ||
<Modal | ||
testID={'modal'} | ||
isVisible={isOpen} | ||
onSwipeComplete={closeBottomSheet} | ||
swipeDirection={['down']} | ||
style={styles.view}> | ||
<View style={styles.content}> | ||
<Text style={styles.contentTitle}>What do you wanna do?</Text> | ||
{options.map((item) => { | ||
const {text, onPress} = item; | ||
return ( | ||
<Button | ||
key={text} | ||
mode="text" | ||
labelStyle={styles.contentOptions} | ||
onPress={onPress}> | ||
{text} | ||
</Button> | ||
); | ||
})} | ||
<Button | ||
key="cancel" | ||
mode="text" | ||
color={DarkTheme.colors.error} | ||
labelStyle={styles.contentCancel} | ||
onPress={closeBottomSheet}> | ||
Cancel | ||
</Button> | ||
</View> | ||
</Modal> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
view: { | ||
justifyContent: 'flex-end', | ||
margin: 0, | ||
}, | ||
content: { | ||
backgroundColor: DarkTheme.colors.background, | ||
padding: 22, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
borderRadius: 4, | ||
borderColor: 'rgba(0, 0, 0, 0.1)', | ||
}, | ||
contentTitle: { | ||
...Styles.fontMedium, | ||
marginBottom: 12, | ||
color: 'white', | ||
}, | ||
contentOptions: { | ||
...Styles.fontMedium, | ||
marginVertical: 4, | ||
}, | ||
contentCancel: { | ||
...Styles.fontMedium, | ||
marginTop: 10, | ||
}, | ||
}); | ||
|
||
export default BottomSheet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.