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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. marginHorizontal: 6,
  17. marginTop: 6,
  18. width: BUTTON_SIZE
  19. };
  20. /**
  21. * The icon style of the toolbar buttons.
  22. */
  23. const toolbarButtonIcon = {
  24. alignSelf: 'center',
  25. color: ColorPalette.darkGrey,
  26. fontSize: 24
  27. };
  28. /**
  29. * The icon style of toolbar buttons which display white icons.
  30. */
  31. const whiteToolbarButtonIcon = {
  32. ...toolbarButtonIcon,
  33. color: ColorPalette.white
  34. };
  35. /**
  36. * The style of reaction buttons.
  37. */
  38. const reactionButton = {
  39. ...toolbarButton,
  40. backgroundColor: 'transparent',
  41. alignItems: 'center',
  42. marginTop: 0,
  43. marginHorizontal: 0
  44. };
  45. /**
  46. * The style of the emoji on the reaction buttons.
  47. */
  48. const reactionEmoji = {
  49. fontSize: 20,
  50. color: ColorPalette.white
  51. };
  52. const reactionMenu = {
  53. flexDirection: 'column',
  54. justifyContent: 'center',
  55. alignItems: 'center',
  56. backgroundColor: ColorPalette.black,
  57. padding: 16
  58. };
  59. /**
  60. * The Toolbox and toolbar related styles.
  61. */
  62. const styles = {
  63. sheetGestureRecognizer: {
  64. alignItems: 'stretch',
  65. flexDirection: 'column'
  66. },
  67. /**
  68. * The style of the toolbar.
  69. */
  70. toolbox: {
  71. alignItems: 'center',
  72. backgroundColor: ColorPalette.darkBackground,
  73. borderTopLeftRadius: 3,
  74. borderTopRightRadius: 3,
  75. flexDirection: 'row',
  76. flexGrow: 0,
  77. justifyContent: 'space-between',
  78. paddingHorizontal: BoxModel.margin,
  79. paddingVertical: 8
  80. },
  81. /**
  82. * The style of the root/top-level container of {@link Toolbox}.
  83. */
  84. toolboxContainer: {
  85. flexDirection: 'column',
  86. flexGrow: 0,
  87. width: '100%',
  88. maxWidth: 580,
  89. marginLeft: 'auto',
  90. marginRight: 'auto'
  91. }
  92. };
  93. export default styles;
  94. /**
  95. * Color schemed styles for the @{Toolbox} component.
  96. */
  97. ColorSchemeRegistry.register('Toolbox', {
  98. /**
  99. * Styles for buttons in the toolbar.
  100. */
  101. buttonStyles: {
  102. iconStyle: toolbarButtonIcon,
  103. style: toolbarButton
  104. },
  105. buttonStylesBorderless: {
  106. iconStyle: whiteToolbarButtonIcon,
  107. style: {
  108. ...toolbarButton,
  109. backgroundColor: 'transparent'
  110. }
  111. },
  112. backgroundToggle: {
  113. backgroundColor: ColorPalette.toggled
  114. },
  115. hangupButtonStyles: {
  116. iconStyle: whiteToolbarButtonIcon,
  117. style: {
  118. ...toolbarButton,
  119. backgroundColor: schemeColor('hangup')
  120. },
  121. underlayColor: ColorPalette.buttonUnderlay
  122. },
  123. reactionDialog: {
  124. position: 'absolute',
  125. width: '100%',
  126. height: '100%',
  127. backgroundColor: 'transparent'
  128. },
  129. overflowReactionMenu: reactionMenu,
  130. reactionMenu: {
  131. ...reactionMenu,
  132. borderRadius: 3,
  133. width: 360
  134. },
  135. reactionRow: {
  136. flexDirection: 'row',
  137. justifyContent: 'space-between',
  138. alignItems: 'center',
  139. width: '100%',
  140. marginBottom: 16
  141. },
  142. reactionButton: {
  143. style: reactionButton,
  144. underlayColor: ColorPalette.toggled,
  145. emoji: reactionEmoji
  146. },
  147. raiseHandButton: {
  148. style: {
  149. ...reactionButton,
  150. backgroundColor: ColorPalette.toggled,
  151. width: '100%',
  152. borderRadius: 6
  153. },
  154. underlayColor: ColorPalette.toggled,
  155. emoji: reactionEmoji,
  156. text: {
  157. color: ColorPalette.white,
  158. fontWeight: '600',
  159. marginLeft: 8,
  160. lineHeight: 24
  161. },
  162. container: {
  163. flexDirection: 'row',
  164. alignItems: 'center',
  165. justifyContent: 'center'
  166. }
  167. },
  168. emojiAnimation: {
  169. color: ColorPalette.white,
  170. position: 'absolute',
  171. zIndex: 1001,
  172. elevation: 2,
  173. fontSize: 20,
  174. left: '50%',
  175. top: '100%'
  176. },
  177. /**
  178. * Styles for toggled buttons in the toolbar.
  179. */
  180. toggledButtonStyles: {
  181. iconStyle: whiteToolbarButtonIcon,
  182. style: {
  183. ...toolbarButton
  184. }
  185. }
  186. });