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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. // @flow
  2. import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
  3. import BaseTheme from '../../../base/ui/components/BaseTheme.native';
  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. marginVertical: 6,
  18. width: BUTTON_SIZE
  19. };
  20. /**
  21. * The icon style of the toolbar buttons.
  22. */
  23. const toolbarButtonIcon = {
  24. alignSelf: 'center',
  25. color: BaseTheme.palette.icon04,
  26. fontSize: 24
  27. };
  28. /**
  29. * The icon style of toolbar buttons which display white icons.
  30. */
  31. const whiteToolbarButtonIcon = {
  32. ...toolbarButtonIcon,
  33. color: BaseTheme.palette.icon01
  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. const gifButton = {
  46. ...reactionButton,
  47. backgroundColor: '#000'
  48. };
  49. /**
  50. * The style of the emoji on the reaction buttons.
  51. */
  52. const reactionEmoji = {
  53. fontSize: 20,
  54. color: BaseTheme.palette.icon01
  55. };
  56. const reactionMenu = {
  57. flexDirection: 'column',
  58. justifyContent: 'center',
  59. alignItems: 'center',
  60. backgroundColor: BaseTheme.palette.bottomSheet,
  61. padding: BaseTheme.spacing[3]
  62. };
  63. /**
  64. * The Toolbox and toolbar related styles.
  65. */
  66. const styles = {
  67. sheetGestureRecognizer: {
  68. alignItems: 'stretch',
  69. flexDirection: 'column'
  70. },
  71. /**
  72. * The style of the toolbar.
  73. */
  74. toolbox: {
  75. alignItems: 'center',
  76. backgroundColor: BaseTheme.palette.uiBackground,
  77. borderTopLeftRadius: 3,
  78. borderTopRightRadius: 3,
  79. flexDirection: 'row',
  80. justifyContent: 'space-between'
  81. },
  82. /**
  83. * The style of the root/top-level container of {@link Toolbox}.
  84. */
  85. toolboxContainer: {
  86. backgroundColor: BaseTheme.palette.uiBackground,
  87. flexDirection: 'column',
  88. maxWidth: 580,
  89. marginLeft: 'auto',
  90. marginRight: 'auto',
  91. width: '100%'
  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. hangupMenuContainer: {
  117. marginHorizontal: BaseTheme.spacing[2],
  118. marginVertical: BaseTheme.spacing[2]
  119. },
  120. hangupButton: {
  121. flex: 1,
  122. marginHorizontal: BaseTheme.spacing[2],
  123. marginVertical: BaseTheme.spacing[2]
  124. },
  125. hangupButtonStyles: {
  126. iconStyle: whiteToolbarButtonIcon,
  127. style: {
  128. ...toolbarButton,
  129. backgroundColor: schemeColor('hangup')
  130. },
  131. underlayColor: BaseTheme.palette.underlay01
  132. },
  133. reactionDialog: {
  134. position: 'absolute',
  135. width: '100%',
  136. height: '100%',
  137. backgroundColor: 'transparent'
  138. },
  139. overflowReactionMenu: reactionMenu,
  140. reactionMenu: {
  141. ...reactionMenu,
  142. borderRadius: 3,
  143. width: 360
  144. },
  145. reactionRow: {
  146. flexDirection: 'row',
  147. justifyContent: 'space-between',
  148. alignItems: 'center',
  149. width: '100%'
  150. },
  151. reactionButton: {
  152. gifButton,
  153. style: reactionButton,
  154. underlayColor: BaseTheme.palette.ui13,
  155. emoji: reactionEmoji
  156. },
  157. emojiAnimation: {
  158. color: BaseTheme.palette.icon01,
  159. position: 'absolute',
  160. zIndex: 1001,
  161. elevation: 2,
  162. fontSize: 20,
  163. left: '50%',
  164. top: '100%'
  165. },
  166. /**
  167. * Styles for toggled buttons in the toolbar.
  168. */
  169. toggledButtonStyles: {
  170. iconStyle: whiteToolbarButtonIcon,
  171. style: {
  172. ...toolbarButton
  173. }
  174. }
  175. });