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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // @flow
  2. import { StyleSheet } from 'react-native';
  3. import { ColorPalette } from '../../../styles';
  4. import { PRESENCE_AVAILABLE_COLOR, PRESENCE_AWAY_COLOR, PRESENCE_BUSY_COLOR, PRESENCE_IDLE_COLOR } from '../styles';
  5. const DEFAULT_SIZE = 65;
  6. /**
  7. * The styles of the feature base/participants.
  8. */
  9. export default {
  10. avatarContainer: (size: number = DEFAULT_SIZE) => {
  11. return {
  12. alignItems: 'center',
  13. borderRadius: size / 2,
  14. height: size,
  15. justifyContent: 'center',
  16. overflow: 'hidden',
  17. width: size
  18. };
  19. },
  20. avatarContent: (size: number = DEFAULT_SIZE) => {
  21. return {
  22. height: size,
  23. width: size
  24. };
  25. },
  26. badge: (size: number = DEFAULT_SIZE, status: string) => {
  27. let color;
  28. switch (status) {
  29. case 'available':
  30. color = PRESENCE_AVAILABLE_COLOR;
  31. break;
  32. case 'away':
  33. color = PRESENCE_AWAY_COLOR;
  34. break;
  35. case 'busy':
  36. color = PRESENCE_BUSY_COLOR;
  37. break;
  38. case 'idle':
  39. color = PRESENCE_IDLE_COLOR;
  40. break;
  41. }
  42. return {
  43. backgroundColor: color,
  44. borderRadius: size / 2,
  45. bottom: 0,
  46. height: size * 0.3,
  47. position: 'absolute',
  48. width: size * 0.3
  49. };
  50. },
  51. badgeContainer: {
  52. ...StyleSheet.absoluteFillObject
  53. },
  54. initialsContainer: {
  55. alignItems: 'center',
  56. alignSelf: 'stretch',
  57. flex: 1,
  58. justifyContent: 'center'
  59. },
  60. initialsText: (size: number = DEFAULT_SIZE) => {
  61. return {
  62. color: 'white',
  63. fontSize: size * 0.45,
  64. fontWeight: '100'
  65. };
  66. },
  67. staticAvatar: {
  68. backgroundColor: ColorPalette.lightGrey,
  69. opacity: 0.4
  70. }
  71. };