您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

styles.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // @flow
  2. import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
  3. import { BoxModel, ColorPalette } from '../../../base/styles';
  4. const BUTTON_SIZE = 48;
  5. // Toolbox, toolbar:
  6. /**
  7. * The style of toolbar buttons.
  8. */
  9. const toolbarButton = {
  10. borderRadius: 3,
  11. borderWidth: 0,
  12. flex: 0,
  13. flexDirection: 'row',
  14. height: BUTTON_SIZE,
  15. justifyContent: 'center',
  16. // XXX We probably tested BoxModel.margin and discovered it to be too small
  17. // for our taste.
  18. marginHorizontal: 7,
  19. width: BUTTON_SIZE
  20. };
  21. /**
  22. * The icon style of the toolbar buttons.
  23. */
  24. const toolbarButtonIcon = {
  25. alignSelf: 'center',
  26. color: ColorPalette.darkGrey,
  27. fontSize: 24
  28. };
  29. /**
  30. * The icon style of toolbar buttons which display white icons.
  31. */
  32. const whiteToolbarButtonIcon = {
  33. ...toolbarButtonIcon,
  34. color: ColorPalette.white
  35. };
  36. /**
  37. * The Toolbox and toolbar related styles.
  38. */
  39. const styles = {
  40. expandMenuContainer: {
  41. alignItems: 'center',
  42. borderTopLeftRadius: 16,
  43. borderTopRightRadius: 16,
  44. flexDirection: 'column'
  45. },
  46. sheetGestureRecognizer: {
  47. alignItems: 'stretch',
  48. flexDirection: 'column'
  49. },
  50. /**
  51. * The style of the toolbar.
  52. */
  53. toolbar: {
  54. alignItems: 'center',
  55. backgroundColor: ColorPalette.darkBackground,
  56. flexDirection: 'row',
  57. flexGrow: 0,
  58. justifyContent: 'space-between',
  59. paddingHorizontal: BoxModel.margin,
  60. paddingVertical: 8
  61. },
  62. /**
  63. * The style of the root/top-level {@link Container} of {@link Toolbox}.
  64. */
  65. toolbox: {
  66. flexDirection: 'column',
  67. flexGrow: 0
  68. }
  69. };
  70. export default styles;
  71. /**
  72. * Color schemed styles for the @{Toolbox} component.
  73. */
  74. ColorSchemeRegistry.register('Toolbox', {
  75. /**
  76. * Styles for buttons in the toolbar.
  77. */
  78. buttonStyles: {
  79. iconStyle: toolbarButtonIcon,
  80. style: toolbarButton
  81. },
  82. buttonStylesBorderless: {
  83. iconStyle: whiteToolbarButtonIcon,
  84. style: {
  85. ...toolbarButton,
  86. backgroundColor: 'transparent'
  87. }
  88. },
  89. /**
  90. * Overrides to the standard styles that we apply to the chat button, as
  91. * that behaves slightly differently to other buttons.
  92. */
  93. chatButtonOverride: {
  94. toggled: {
  95. backgroundColor: ColorPalette.blue
  96. }
  97. },
  98. hangupButtonStyles: {
  99. iconStyle: whiteToolbarButtonIcon,
  100. style: {
  101. ...toolbarButton,
  102. backgroundColor: schemeColor('hangup')
  103. },
  104. underlayColor: ColorPalette.buttonUnderlay
  105. },
  106. /**
  107. * Styles for toggled buttons in the toolbar.
  108. */
  109. toggledButtonStyles: {
  110. iconStyle: whiteToolbarButtonIcon,
  111. style: {
  112. ...toolbarButton
  113. }
  114. }
  115. });