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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. 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. },
  142. reactionButton: {
  143. gifButton,
  144. style: reactionButton,
  145. underlayColor: BaseTheme.palette.ui13,
  146. emoji: reactionEmoji
  147. },
  148. emojiAnimation: {
  149. color: BaseTheme.palette.icon01,
  150. position: 'absolute',
  151. zIndex: 1001,
  152. elevation: 2,
  153. fontSize: 20,
  154. left: '50%',
  155. top: '100%'
  156. },
  157. /**
  158. * Styles for toggled buttons in the toolbar.
  159. */
  160. toggledButtonStyles: {
  161. iconStyle: whiteToolbarButtonIcon,
  162. style: {
  163. ...toolbarButton
  164. }
  165. }
  166. });