react-native-navigation的迁移库

TopTabScreen.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. const React = require('react');
  2. const { PureComponent } = require('react');
  3. const { View, Text } = require('react-native');
  4. const FAB = 'fab';
  5. class TopTabScreen extends PureComponent {
  6. static options() {
  7. return {
  8. topBar: {
  9. title: {
  10. color: 'black',
  11. fontSize: 16,
  12. fontFamily: 'HelveticaNeue-Italic'
  13. }
  14. },
  15. fab: {
  16. id: FAB,
  17. backgroundColor: 'blue',
  18. clickColor: 'blue',
  19. rippleColor: 'aquamarine'
  20. }
  21. };
  22. }
  23. render() {
  24. return (
  25. <View style={styles.root}>
  26. <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
  27. <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
  28. </View>
  29. );
  30. }
  31. }
  32. module.exports = TopTabScreen;
  33. const styles = {
  34. root: {
  35. flexGrow: 1,
  36. justifyContent: 'center',
  37. alignItems: 'center',
  38. backgroundColor: '#f5fcff'
  39. },
  40. h1: {
  41. fontSize: 24,
  42. textAlign: 'center',
  43. margin: 10
  44. },
  45. h2: {
  46. fontSize: 12,
  47. textAlign: 'center',
  48. margin: 10
  49. },
  50. footer: {
  51. fontSize: 10,
  52. color: '#888',
  53. marginTop: 10
  54. }
  55. };