Skip to content

Instantly share code, notes, and snippets.

@jai-adapptor
Last active July 25, 2022 13:52
Show Gist options
  • Save jai-adapptor/937238d7bd8813a71e4865552da25616 to your computer and use it in GitHub Desktop.
Save jai-adapptor/937238d7bd8813a71e4865552da25616 to your computer and use it in GitHub Desktop.
7: Styles
const styles = StyleSheet.create({
// The sheet is positioned absolutely to sit at the bottom of the screen
container: {
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
},
sheet: {
justifyContent: 'flex-start',
backgroundColor: '#FFFFFF',
// Round the top corners
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
minHeight: 80,
// Add a shadow to the top of the sheet
shadowColor: '#000',
shadowOffset: {
width: 0,
height: -2,
},
shadowOpacity: 0.23,
shadowRadius: 2.62,
elevation: 4,
},
handleContainer: {
alignItems: 'center',
justifyContent: 'center',
paddingTop: 10,
},
// Add a small handle component to indicate the sheet can be dragged
handle: {
width: '15%',
height: 4,
borderRadius: 8,
backgroundColor: '#CCCCCC',
},
closeButton: {
width: NAV_HEIGHT,
height: NAV_HEIGHT,
borderRadius: NAV_HEIGHT,
alignItems: 'center',
justifyContent: 'center',
alignSelf: 'flex-start',
marginBottom: 10,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment