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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. import ColorSchemeRegistry from '../../../base/color-scheme/ColorSchemeRegistry';
  2. import { schemeColor } from '../../../base/color-scheme/functions';
  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: BaseTheme.shape.borderRadius,
  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.ui01,
  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. underlayColor: 'transparent'
  113. },
  114. backgroundToggle: {
  115. backgroundColor: BaseTheme.palette.ui04
  116. },
  117. hangupMenuContainer: {
  118. marginHorizontal: BaseTheme.spacing[2],
  119. marginVertical: BaseTheme.spacing[2]
  120. },
  121. hangupButton: {
  122. flex: 1,
  123. marginHorizontal: BaseTheme.spacing[2],
  124. marginVertical: BaseTheme.spacing[2]
  125. },
  126. hangupButtonStyles: {
  127. iconStyle: whiteToolbarButtonIcon,
  128. style: {
  129. ...toolbarButton,
  130. backgroundColor: schemeColor('hangup')
  131. },
  132. underlayColor: BaseTheme.palette.ui04
  133. },
  134. reactionDialog: {
  135. position: 'absolute',
  136. width: '100%',
  137. height: '100%',
  138. backgroundColor: 'transparent'
  139. },
  140. overflowReactionMenu: reactionMenu,
  141. reactionMenu: {
  142. ...reactionMenu,
  143. borderRadius: 3,
  144. width: 360
  145. },
  146. reactionRow: {
  147. flexDirection: 'row',
  148. justifyContent: 'space-between',
  149. alignItems: 'center',
  150. width: '100%'
  151. },
  152. reactionButton: {
  153. gifButton,
  154. style: reactionButton,
  155. underlayColor: BaseTheme.palette.ui04,
  156. emoji: reactionEmoji
  157. },
  158. emojiAnimation: {
  159. color: BaseTheme.palette.icon01,
  160. position: 'absolute',
  161. zIndex: 1001,
  162. elevation: 2,
  163. fontSize: 20,
  164. left: '50%',
  165. top: '100%'
  166. },
  167. /**
  168. * Styles for toggled buttons in the toolbar.
  169. */
  170. toggledButtonStyles: {
  171. iconStyle: whiteToolbarButtonIcon,
  172. style: {
  173. ...toolbarButton
  174. },
  175. underlayColor: 'transparent'
  176. }
  177. });