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 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. // @flow
  2. import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
  3. import { BoxModel, ColorPalette } from '../../../base/styles';
  4. import BaseTheme from '../../../base/ui/components/BaseTheme.native';
  5. const BUBBLE_RADIUS = 8;
  6. /**
  7. * The styles of the feature chat.
  8. *
  9. * NOTE: Sizes and colors come from the 8x8 guidelines. This is the first
  10. * component to receive this treating, if others happen to have similar, we
  11. * need to extract the brand colors and sizes into a branding feature (planned
  12. * for the future).
  13. */
  14. export default {
  15. /**
  16. * Wrapper View for the avatar.
  17. */
  18. avatarWrapper: {
  19. marginRight: 8,
  20. width: 32
  21. },
  22. chatLink: {
  23. color: ColorPalette.blue
  24. },
  25. /**
  26. * Wrapper for the details together, such as name, message and time.
  27. */
  28. detailsWrapper: {
  29. alignItems: 'flex-start',
  30. flex: 1,
  31. flexDirection: 'column'
  32. },
  33. emptyComponentWrapper: {
  34. alignSelf: 'center',
  35. flex: 1,
  36. padding: BoxModel.padding,
  37. paddingTop: '8%',
  38. maxWidth: '80%'
  39. },
  40. /**
  41. * A special padding to avoid issues on some devices (such as Android devices with custom suggestions bar).
  42. */
  43. extraBarPadding: {
  44. paddingBottom: 30
  45. },
  46. inputBar: {
  47. alignItems: 'center',
  48. borderTopColor: 'rgb(209, 219, 231)',
  49. borderTopWidth: 1,
  50. flexDirection: 'row',
  51. paddingBottom: '4%',
  52. paddingHorizontal: BaseTheme.spacing[3]
  53. },
  54. inputField: {
  55. color: BaseTheme.palette.text01,
  56. flex: 1,
  57. height: 48
  58. },
  59. messageBubble: {
  60. alignItems: 'center',
  61. borderRadius: BUBBLE_RADIUS,
  62. flexDirection: 'row'
  63. },
  64. /**
  65. * Wrapper View for the entire block.
  66. */
  67. messageWrapper: {
  68. alignItems: 'flex-start',
  69. flex: 1,
  70. flexDirection: 'row',
  71. marginHorizontal: 17,
  72. marginVertical: 4
  73. },
  74. /**
  75. * Style modifier for the {@code detailsWrapper} for own messages.
  76. */
  77. ownMessageDetailsWrapper: {
  78. alignItems: 'flex-end'
  79. },
  80. replyWrapper: {
  81. alignItems: 'center',
  82. flexDirection: 'row'
  83. },
  84. sendButtonIcon: {
  85. color: BaseTheme.palette.icon01,
  86. fontSize: 22
  87. },
  88. /**
  89. * Style modifier for system (error) messages.
  90. */
  91. systemMessageBubble: {
  92. backgroundColor: 'rgb(247, 215, 215)'
  93. },
  94. /**
  95. * Wrapper for the name and the message text.
  96. */
  97. textWrapper: {
  98. alignItems: 'flex-start',
  99. flexDirection: 'column',
  100. padding: 9
  101. },
  102. /**
  103. * Text node for the timestamp.
  104. */
  105. timeText: {
  106. color: 'rgb(164, 184, 209)',
  107. fontSize: 13
  108. },
  109. chatContainer: {
  110. backgroundColor: BaseTheme.palette.ui01,
  111. flex: 1
  112. },
  113. tabContainer: {
  114. flexDirection: 'row',
  115. justifyContent: 'center'
  116. },
  117. tabLeftButton: {
  118. flex: 1,
  119. borderTopLeftRadius: 0,
  120. borderTopRightRadius: 0,
  121. borderBottomLeftRadius: 0
  122. },
  123. tabRightButton: {
  124. flex: 1,
  125. borderTopLeftRadius: 0,
  126. borderTopRightRadius: 0,
  127. borderBottomRightRadius: 0
  128. },
  129. gifContainer: {
  130. maxHeight: 150
  131. },
  132. gifImage: {
  133. resizeMode: 'contain',
  134. width: 250,
  135. height: undefined,
  136. flexGrow: 1
  137. }
  138. };
  139. ColorSchemeRegistry.register('Chat', {
  140. /**
  141. * Background of the chat screen.
  142. */
  143. backdrop: {
  144. backgroundColor: schemeColor('background'),
  145. flex: 1
  146. },
  147. /**
  148. * The text node for the display name.
  149. */
  150. displayName: {
  151. color: schemeColor('displayName'),
  152. fontSize: 13
  153. },
  154. emptyComponentText: {
  155. color: BaseTheme.palette.text03,
  156. textAlign: 'center'
  157. },
  158. lobbyMessageBubble: {
  159. backgroundColor: schemeColor('lobbyMsgBackground')
  160. },
  161. lobbyMsgNotice: {
  162. color: schemeColor('lobbyMsgNotice'),
  163. fontSize: 11,
  164. marginTop: 6
  165. },
  166. lobbyMessageRecipientContainer: {
  167. alignItems: 'center',
  168. backgroundColor: schemeColor('lobbyMsgBackground'),
  169. flexDirection: 'row',
  170. padding: BoxModel.padding
  171. },
  172. localMessageBubble: {
  173. backgroundColor: schemeColor('localMsgBackground'),
  174. borderTopRightRadius: 0
  175. },
  176. messageRecipientCancelIcon: {
  177. color: schemeColor('icon'),
  178. fontSize: 18
  179. },
  180. messageRecipientContainer: {
  181. alignItems: 'center',
  182. backgroundColor: schemeColor('privateMsgBackground'),
  183. flexDirection: 'row',
  184. padding: BoxModel.padding
  185. },
  186. messageRecipientText: {
  187. color: schemeColor('text'),
  188. flex: 1
  189. },
  190. privateNotice: {
  191. color: schemeColor('privateMsgNotice'),
  192. fontSize: 11,
  193. marginTop: 6
  194. },
  195. privateMessageBubble: {
  196. backgroundColor: schemeColor('privateMsgBackground')
  197. },
  198. remoteMessageBubble: {
  199. backgroundColor: schemeColor('remoteMsgBackground'),
  200. borderTopLeftRadius: 0
  201. },
  202. replyContainer: {
  203. alignSelf: 'stretch',
  204. borderLeftColor: schemeColor('replyBorder'),
  205. borderLeftWidth: 1,
  206. justifyContent: 'center'
  207. },
  208. replyStyles: {
  209. iconStyle: {
  210. color: schemeColor('replyIcon'),
  211. fontSize: 22,
  212. padding: 8
  213. }
  214. }
  215. });