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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. flexDirection: 'row',
  49. justifyContent: 'space-between',
  50. marginLeft: BaseTheme.spacing[3],
  51. width: '100%'
  52. },
  53. customInput: {
  54. width: 280
  55. },
  56. messageBubble: {
  57. alignItems: 'center',
  58. borderRadius: BUBBLE_RADIUS,
  59. flexDirection: 'row'
  60. },
  61. /**
  62. * Wrapper View for the entire block.
  63. */
  64. messageWrapper: {
  65. alignItems: 'flex-start',
  66. flex: 1,
  67. flexDirection: 'row',
  68. marginHorizontal: 17,
  69. marginVertical: 4
  70. },
  71. /**
  72. * Style modifier for the {@code detailsWrapper} for own messages.
  73. */
  74. ownMessageDetailsWrapper: {
  75. alignItems: 'flex-end'
  76. },
  77. replyWrapper: {
  78. alignItems: 'center',
  79. flexDirection: 'row'
  80. },
  81. sendButton: {
  82. marginRight: BaseTheme.spacing[5]
  83. },
  84. /**
  85. * Style modifier for system (error) messages.
  86. */
  87. systemMessageBubble: {
  88. backgroundColor: 'rgb(247, 215, 215)'
  89. },
  90. /**
  91. * Wrapper for the name and the message text.
  92. */
  93. textWrapper: {
  94. alignItems: 'flex-start',
  95. flexDirection: 'column',
  96. padding: 9
  97. },
  98. /**
  99. * Text node for the timestamp.
  100. */
  101. timeText: {
  102. color: 'rgb(164, 184, 209)',
  103. fontSize: 13
  104. },
  105. chatContainer: {
  106. backgroundColor: BaseTheme.palette.ui01,
  107. flex: 1
  108. },
  109. tabContainer: {
  110. flexDirection: 'row',
  111. justifyContent: 'center'
  112. },
  113. tabLeftButton: {
  114. flex: 1,
  115. borderTopLeftRadius: 0,
  116. borderTopRightRadius: 0,
  117. borderBottomLeftRadius: 0
  118. },
  119. tabRightButton: {
  120. flex: 1,
  121. borderTopLeftRadius: 0,
  122. borderTopRightRadius: 0,
  123. borderBottomRightRadius: 0
  124. },
  125. gifContainer: {
  126. maxHeight: 150
  127. },
  128. gifImage: {
  129. resizeMode: 'contain',
  130. width: 250,
  131. height: undefined,
  132. flexGrow: 1
  133. }
  134. };
  135. ColorSchemeRegistry.register('Chat', {
  136. /**
  137. * Background of the chat screen.
  138. */
  139. backdrop: {
  140. backgroundColor: schemeColor('background'),
  141. flex: 1
  142. },
  143. /**
  144. * The text node for the display name.
  145. */
  146. displayName: {
  147. color: schemeColor('displayName'),
  148. fontSize: 13
  149. },
  150. emptyComponentText: {
  151. color: BaseTheme.palette.text03,
  152. textAlign: 'center'
  153. },
  154. lobbyMessageBubble: {
  155. backgroundColor: schemeColor('lobbyMsgBackground')
  156. },
  157. lobbyMsgNotice: {
  158. color: schemeColor('lobbyMsgNotice'),
  159. fontSize: 11,
  160. marginTop: 6
  161. },
  162. lobbyMessageRecipientContainer: {
  163. alignItems: 'center',
  164. backgroundColor: schemeColor('lobbyMsgBackground'),
  165. flexDirection: 'row',
  166. padding: BoxModel.padding
  167. },
  168. localMessageBubble: {
  169. backgroundColor: schemeColor('localMsgBackground'),
  170. borderTopRightRadius: 0
  171. },
  172. messageRecipientCancelIcon: {
  173. color: schemeColor('icon'),
  174. fontSize: 18
  175. },
  176. messageRecipientContainer: {
  177. alignItems: 'center',
  178. backgroundColor: schemeColor('privateMsgBackground'),
  179. flexDirection: 'row',
  180. padding: BoxModel.padding
  181. },
  182. messageRecipientText: {
  183. color: schemeColor('text'),
  184. flex: 1
  185. },
  186. privateNotice: {
  187. color: schemeColor('privateMsgNotice'),
  188. fontSize: 11,
  189. marginTop: 6
  190. },
  191. privateMessageBubble: {
  192. backgroundColor: schemeColor('privateMsgBackground')
  193. },
  194. remoteMessageBubble: {
  195. backgroundColor: schemeColor('remoteMsgBackground'),
  196. borderTopLeftRadius: 0
  197. },
  198. replyContainer: {
  199. alignSelf: 'stretch',
  200. borderLeftColor: schemeColor('replyBorder'),
  201. borderLeftWidth: 1,
  202. justifyContent: 'center'
  203. },
  204. replyStyles: {
  205. iconStyle: {
  206. color: schemeColor('replyIcon'),
  207. fontSize: 22,
  208. padding: 8
  209. }
  210. }
  211. });