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

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