Button.js 685 B

12345678910111213141516171819202122232425262728293031323334
  1. import React, { memo } from 'react';
  2. import { StyleSheet } from 'react-native';
  3. import { Button as PaperButton } from 'react-native-paper';
  4. import { theme } from '../core/theme';
  5. const Button = ({ mode, style, children, ...props }) => (
  6. <PaperButton
  7. style={[
  8. styles.button,
  9. mode === 'outlined' && { backgroundColor: theme.colors.surface },
  10. style,
  11. ]}
  12. labelStyle={styles.text}
  13. mode={mode}
  14. {...props}
  15. >
  16. {children}
  17. </PaperButton>
  18. );
  19. const styles = StyleSheet.create({
  20. button: {
  21. width: '100%',
  22. marginVertical: 10,
  23. },
  24. text: {
  25. fontWeight: 'bold',
  26. fontSize: 15,
  27. lineHeight: 26,
  28. },
  29. });
  30. export default memo(Button);