Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. const styles = StyleSheet.create({
  2. ...
  3. swipeButtonCommon:{
  4. backgroundColor: Color.listActionBackground
  5. },
  6. ...
  7.  
  8. })
  9.  
  10. function SwipeButton(title:string, side: 'left' | 'center' | 'right'){
  11. let styleClass: string | null = null;
  12.  
  13. if(side == 'left'){
  14. styleClass = 'swipeButtonLeft';
  15. }else if(side == 'right'){
  16. styleClass = 'swipeButtonRight'
  17. }
  18. return (
  19. <View style={[styles.swipeButtonCommon, styles[styleClass!]]}><Text>{title}</Text></View>
  20. )
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement