You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

headerstyles.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // @flex
  2. import { StyleSheet } from 'react-native';
  3. import { ColorSchemeRegistry, schemeColor } from '../../../color-scheme';
  4. import { BoxModel } from '../../../styles';
  5. const HEADER_FONT_SIZE = 18;
  6. const HEADER_HEIGHT = 48;
  7. const HEADER_PADDING = BoxModel.padding / 2;
  8. ColorSchemeRegistry.register('Header', {
  9. /**
  10. * Style of a disabled button in the header (e.g. Next).
  11. */
  12. disabledButtonText: {
  13. opacity: 0.6
  14. },
  15. /**
  16. * Platform specific header button (e.g. back, menu, etc).
  17. */
  18. headerButtonIcon: {
  19. alignSelf: 'center',
  20. color: schemeColor('icon'),
  21. fontSize: 22,
  22. marginRight: 12,
  23. padding: 8
  24. },
  25. headerButtonText: {
  26. color: schemeColor('text'),
  27. fontSize: HEADER_FONT_SIZE
  28. },
  29. /**
  30. * Style of the header overlay to cover the unsafe areas.
  31. */
  32. headerOverlay: {
  33. backgroundColor: schemeColor('background')
  34. },
  35. /**
  36. * Generic style for a label placed in the header.
  37. */
  38. headerText: {
  39. color: schemeColor('text'),
  40. fontSize: HEADER_FONT_SIZE
  41. },
  42. headerTextWrapper: {
  43. alignItems: 'center',
  44. justifyContent: 'center',
  45. left: 0,
  46. position: 'absolute',
  47. right: 0
  48. },
  49. /**
  50. * The top-level element of a page.
  51. */
  52. page: {
  53. ...StyleSheet.absoluteFillObject,
  54. alignItems: 'stretch',
  55. flex: 1,
  56. flexDirection: 'column',
  57. overflow: 'hidden'
  58. },
  59. /**
  60. * Base style of Header.
  61. */
  62. screenHeader: {
  63. alignItems: 'center',
  64. backgroundColor: schemeColor('background'),
  65. flexDirection: 'row',
  66. height: HEADER_HEIGHT,
  67. justifyContent: 'space-between',
  68. paddingHorizontal: BoxModel.padding,
  69. paddingVertical: HEADER_PADDING
  70. },
  71. statusBar: schemeColor('statusBar'),
  72. statusBarContent: schemeColor('statusBarContent')
  73. });