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

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