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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. };
  110. ColorSchemeRegistry.register('Chat', {
  111. /**
  112. * Background of the chat screen.
  113. */
  114. backdrop: {
  115. backgroundColor: schemeColor('background'),
  116. flex: 1
  117. },
  118. /**
  119. * The text node for the display name.
  120. */
  121. displayName: {
  122. color: schemeColor('displayName'),
  123. fontSize: 13
  124. },
  125. emptyComponentText: {
  126. color: schemeColor('displayName'),
  127. textAlign: 'center'
  128. },
  129. localMessageBubble: {
  130. backgroundColor: schemeColor('localMsgBackground'),
  131. borderTopRightRadius: 0
  132. },
  133. messageRecipientCancelIcon: {
  134. color: schemeColor('icon'),
  135. fontSize: 18
  136. },
  137. messageRecipientContainer: {
  138. alignItems: 'center',
  139. backgroundColor: schemeColor('privateMsgBackground'),
  140. flexDirection: 'row',
  141. padding: BoxModel.padding
  142. },
  143. messageRecipientText: {
  144. color: schemeColor('text'),
  145. flex: 1
  146. },
  147. privateNotice: {
  148. color: schemeColor('privateMsgNotice'),
  149. fontSize: 11,
  150. marginTop: 6
  151. },
  152. privateMessageBubble: {
  153. backgroundColor: schemeColor('privateMsgBackground')
  154. },
  155. remoteMessageBubble: {
  156. backgroundColor: schemeColor('remoteMsgBackground'),
  157. borderTopLeftRadius: 0
  158. },
  159. replyContainer: {
  160. alignSelf: 'stretch',
  161. borderLeftColor: schemeColor('replyBorder'),
  162. borderLeftWidth: 1,
  163. justifyContent: 'center'
  164. },
  165. replyStyles: {
  166. iconStyle: {
  167. color: schemeColor('replyIcon'),
  168. fontSize: 22,
  169. padding: 8
  170. }
  171. }
  172. });