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.

styles.js 3.1KB

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