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 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. // @flow
  2. import { StyleSheet } from 'react-native';
  3. import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
  4. import { HANGUP_BUTTON_SIZE } from '../../constants';
  5. // Toolbox, toolbar:
  6. /**
  7. * The style of toolbar buttons.
  8. */
  9. const toolbarButton = {
  10. backgroundColor: ColorPalette.white,
  11. borderRadius: 20,
  12. borderWidth: 0,
  13. flex: 0,
  14. flexDirection: 'row',
  15. height: 40,
  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. opacity: 0.7,
  21. width: 40
  22. };
  23. /**
  24. * The icon style of the toolbar buttons.
  25. */
  26. const toolbarButtonIcon = {
  27. alignSelf: 'center',
  28. color: ColorPalette.darkGrey,
  29. fontSize: 22
  30. };
  31. /**
  32. * The Toolbox and toolbar related styles.
  33. */
  34. const styles = createStyleSheet({
  35. /**
  36. * The style of the toolbar button which hangs the current conference up.
  37. */
  38. hangupButton: {
  39. ...toolbarButton,
  40. backgroundColor: ColorPalette.red,
  41. borderRadius: 30,
  42. height: HANGUP_BUTTON_SIZE,
  43. width: HANGUP_BUTTON_SIZE
  44. },
  45. /**
  46. * The icon style of toolbar buttons which hangs the current conference up.
  47. */
  48. hangupButtonIcon: {
  49. ...toolbarButtonIcon,
  50. color: ColorPalette.white,
  51. fontSize: 24
  52. },
  53. /**
  54. * The style of the toolbar.
  55. */
  56. toolbar: {
  57. alignItems: 'center',
  58. bottom: 0,
  59. flex: 0,
  60. flexDirection: 'row',
  61. justifyContent: 'center',
  62. left: 0,
  63. marginBottom: BoxModel.margin / 2,
  64. paddingHorizontal: BoxModel.margin,
  65. position: 'absolute',
  66. right: 0
  67. },
  68. /**
  69. * The style of toolbar buttons.
  70. */
  71. toolbarButton,
  72. /**
  73. * The icon style of the toolbar buttons.
  74. */
  75. toolbarButtonIcon,
  76. /**
  77. * The style of the root/top-level {@link Container} of {@link Toolbox}.
  78. * This is the narrow layout version which locates the toolbar on top of
  79. * the filmstrip, at the bottom of the screen.
  80. */
  81. toolboxNarrow: {
  82. flexDirection: 'column',
  83. flexGrow: 1
  84. },
  85. /**
  86. * The style of the root/top-level {@link Container} of {@link Toolbox}.
  87. * This is the wide layout version which locates the toolbar at the bottom
  88. * of the screen.
  89. */
  90. toolboxWide: {
  91. ...StyleSheet.absoluteFillObject
  92. },
  93. /**
  94. * The style of toolbar buttons which display white icons.
  95. */
  96. whiteToolbarButton: {
  97. ...toolbarButton,
  98. backgroundColor: ColorPalette.buttonUnderlay
  99. },
  100. /**
  101. * The icon style of toolbar buttons which display white icons.
  102. */
  103. whiteToolbarButtonIcon: {
  104. ...toolbarButtonIcon,
  105. color: ColorPalette.white
  106. }
  107. });
  108. export default styles;
  109. /**
  110. * Styles for the hangup button.
  111. */
  112. export const hangupButtonStyles = {
  113. iconStyle: styles.whiteToolbarButtonIcon,
  114. style: styles.hangupButton,
  115. underlayColor: ColorPalette.buttonUnderlay
  116. };
  117. /**
  118. * Styles for buttons in the toolbar.
  119. */
  120. export const toolbarButtonStyles = {
  121. iconStyle: styles.toolbarButtonIcon,
  122. style: styles.toolbarButton
  123. };
  124. /**
  125. * Styles for toggled buttons in the toolbar.
  126. */
  127. export const toolbarToggledButtonStyles = {
  128. iconStyle: styles.whiteToolbarButtonIcon,
  129. style: styles.whiteToolbarButton
  130. };
  131. // Overflow menu:
  132. /**
  133. * Styles for the {@code OverflowMenu} items.
  134. *
  135. * These have been implemented as per the Material Design guidelines:
  136. * {@link https://material.io/guidelines/components/bottom-sheets.html}.
  137. */
  138. const overflowMenuStyles = createStyleSheet({
  139. /**
  140. * Container style for a {@code ToolboxItem} rendered in the
  141. * {@code OverflowMenu}.
  142. */
  143. container: {
  144. alignItems: 'center',
  145. flexDirection: 'row',
  146. height: 48
  147. },
  148. /**
  149. * Style for the {@code Icon} element in a {@code ToolboxItem} rendered in
  150. * the {@code OverflowMenu}.
  151. */
  152. icon: {
  153. fontSize: 24
  154. },
  155. /**
  156. * Style for the label in a {@code ToolboxItem} rendered in the
  157. * {@code OverflowMenu}.
  158. */
  159. label: {
  160. flexShrink: 1,
  161. fontSize: 16,
  162. marginLeft: 32,
  163. opacity: 0.90
  164. }
  165. });
  166. export const overflowMenuItemStyles = {
  167. iconStyle: overflowMenuStyles.icon,
  168. labelStyle: overflowMenuStyles.label,
  169. style: overflowMenuStyles.container,
  170. underlayColor: '#eee'
  171. };