react-native-navigation的迁移库

Button.js 555B

123456789101112131415161718192021222324
  1. const React = require('react');
  2. const { Button } = require('react-native-ui-lib');
  3. const { Platform } = require('react-native');
  4. class RnnButton extends React.PureComponent {
  5. render() {
  6. return (
  7. (this.props.platform ? this.props.platform === Platform.OS : true) ?
  8. <Button
  9. {...this.props}
  10. style={this.getStyle()}
  11. /> : null
  12. )
  13. }
  14. getStyle() {
  15. const style = { marginBottom: 8 };
  16. if (!this.props.testID) {
  17. style.backgroundColor = '#65C888';
  18. }
  19. return style;
  20. }
  21. }
  22. module.exports = RnnButton