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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. chatLink: {
  22. color: ColorPalette.blue
  23. },
  24. /**
  25. * Wrapper for the details together, such as name, message and time.
  26. */
  27. detailsWrapper: {
  28. alignItems: 'flex-start',
  29. flex: 1,
  30. flexDirection: 'column'
  31. },
  32. emptyComponentWrapper: {
  33. alignSelf: 'center',
  34. flex: 1,
  35. padding: BoxModel.padding,
  36. paddingTop: '10%'
  37. },
  38. /**
  39. * A special padding to avoid issues on some devices (such as Android devices with custom suggestions bar).
  40. */
  41. extraBarPadding: {
  42. paddingBottom: 30
  43. },
  44. inputBar: {
  45. alignItems: 'center',
  46. borderTopColor: 'rgb(209, 219, 231)',
  47. borderTopWidth: 1,
  48. flexDirection: 'row',
  49. paddingHorizontal: BoxModel.padding
  50. },
  51. inputField: {
  52. color: 'rgb(28, 32, 37)',
  53. flex: 1,
  54. height: 48
  55. },
  56. messageBubble: {
  57. alignItems: 'center',
  58. borderRadius: BUBBLE_RADIUS,
  59. flexDirection: 'row'
  60. },
  61. messageContainer: {
  62. flex: 1
  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: ColorPalette.darkGrey,
  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. 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. };
  126. ColorSchemeRegistry.register('Chat', {
  127. /**
  128. * Background of the chat screen.
  129. */
  130. backdrop: {
  131. backgroundColor: schemeColor('background'),
  132. flex: 1
  133. },
  134. /**
  135. * The text node for the display name.
  136. */
  137. displayName: {
  138. color: schemeColor('displayName'),
  139. fontSize: 13
  140. },
  141. emptyComponentText: {
  142. color: schemeColor('displayName'),
  143. textAlign: 'center'
  144. },
  145. localMessageBubble: {
  146. backgroundColor: schemeColor('localMsgBackground'),
  147. borderTopRightRadius: 0
  148. },
  149. messageRecipientCancelIcon: {
  150. color: schemeColor('icon'),
  151. fontSize: 18
  152. },
  153. messageRecipientContainer: {
  154. alignItems: 'center',
  155. backgroundColor: schemeColor('privateMsgBackground'),
  156. flexDirection: 'row',
  157. padding: BoxModel.padding
  158. },
  159. messageRecipientText: {
  160. color: schemeColor('text'),
  161. flex: 1
  162. },
  163. privateNotice: {
  164. color: schemeColor('privateMsgNotice'),
  165. fontSize: 11,
  166. marginTop: 6
  167. },
  168. privateMessageBubble: {
  169. backgroundColor: schemeColor('privateMsgBackground')
  170. },
  171. remoteMessageBubble: {
  172. backgroundColor: schemeColor('remoteMsgBackground'),
  173. borderTopLeftRadius: 0
  174. },
  175. replyContainer: {
  176. alignSelf: 'stretch',
  177. borderLeftColor: schemeColor('replyBorder'),
  178. borderLeftWidth: 1,
  179. justifyContent: 'center'
  180. },
  181. replyStyles: {
  182. iconStyle: {
  183. color: schemeColor('replyIcon'),
  184. fontSize: 22,
  185. padding: 8
  186. }
  187. }
  188. });