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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. // @flow
  2. import { BoxModel, ColorPalette } from '../../../styles';
  3. const OVERLAY_FONT_COLOR = 'rgba(255, 255, 255, 0.6)';
  4. const SECONDARY_ACTION_BUTTON_SIZE = 30;
  5. export const AVATAR_SIZE = 65;
  6. export const UNDERLAY_COLOR = 'rgba(255, 255, 255, 0.2)';
  7. /**
  8. * Style classes of the PagedList-based components.
  9. */
  10. const PAGED_LIST_STYLES = {
  11. /**
  12. * Outermost container of a page in {@code PagedList}.
  13. */
  14. pageContainer: {
  15. flex: 1
  16. },
  17. /**
  18. * Style of the page indicator (Android).
  19. */
  20. pageIndicator: {
  21. alignItems: 'center',
  22. flexDirection: 'column',
  23. justifyContent: 'center',
  24. padding: BoxModel.padding / 2
  25. },
  26. /**
  27. * Additional style for the active indicator icon (Android).
  28. */
  29. pageIndicatorActive: {
  30. color: ColorPalette.white
  31. },
  32. /**
  33. * Container for the page indicators (Android).
  34. */
  35. pageIndicatorContainer: {
  36. alignItems: 'center',
  37. backgroundColor: ColorPalette.blue,
  38. flexDirection: 'row',
  39. justifyContent: 'space-around'
  40. },
  41. pageIndicatorContent: {
  42. alignItems: 'center',
  43. flexDirection: 'column',
  44. justifyContent: 'center'
  45. },
  46. /**
  47. * Icon of the page indicator (Android).
  48. */
  49. pageIndicatorIcon: {
  50. color: ColorPalette.blueHighlight,
  51. fontSize: 24
  52. },
  53. /**
  54. * Label of the page indicator (Android).
  55. */
  56. pageIndicatorText: {
  57. color: ColorPalette.blueHighlight
  58. },
  59. /**
  60. * Top level style of the paged list.
  61. */
  62. pagedList: {
  63. flex: 1
  64. },
  65. /**
  66. * The paged list container View.
  67. */
  68. pagedListContainer: {
  69. flex: 1,
  70. flexDirection: 'column'
  71. },
  72. /**
  73. * Disabled style for the container.
  74. */
  75. pagedListContainerDisabled: {
  76. opacity: 0.2
  77. }
  78. };
  79. const SECTION_LIST_STYLES = {
  80. /**
  81. * The style of the avatar container that makes the avatar rounded.
  82. */
  83. avatarContainer: {
  84. alignItems: 'center',
  85. flexDirection: 'row',
  86. justifyContent: 'space-around',
  87. padding: 5
  88. },
  89. /**
  90. * Simple {@code Text} content of the avatar (the actual initials).
  91. */
  92. avatarContent: {
  93. backgroundColor: 'rgba(0, 0, 0, 0)',
  94. color: OVERLAY_FONT_COLOR,
  95. fontSize: Math.floor(AVATAR_SIZE / 2),
  96. fontWeight: '100',
  97. textAlign: 'center'
  98. },
  99. /**
  100. * The top level container style of the list.
  101. */
  102. container: {
  103. flex: 1
  104. },
  105. list: {
  106. flex: 1,
  107. flexDirection: 'column'
  108. },
  109. listItem: {
  110. alignItems: 'center',
  111. flex: 1,
  112. flexDirection: 'row',
  113. padding: 5
  114. },
  115. listItemDetails: {
  116. flex: 1,
  117. flexDirection: 'column',
  118. overflow: 'hidden',
  119. paddingHorizontal: 5
  120. },
  121. listItemText: {
  122. color: OVERLAY_FONT_COLOR,
  123. fontSize: 14
  124. },
  125. listItemTitle: {
  126. fontWeight: 'bold',
  127. fontSize: 16
  128. },
  129. listSection: {
  130. alignItems: 'center',
  131. backgroundColor: 'rgba(255, 255, 255, 0.2)',
  132. flex: 1,
  133. flexDirection: 'row',
  134. paddingVertical: 5,
  135. paddingHorizontal: 10
  136. },
  137. listSectionText: {
  138. color: OVERLAY_FONT_COLOR,
  139. fontSize: 14,
  140. fontWeight: 'normal'
  141. },
  142. pullToRefresh: {
  143. alignItems: 'center',
  144. flex: 1,
  145. flexDirection: 'column',
  146. justifyContent: 'center',
  147. padding: 20
  148. },
  149. pullToRefreshIcon: {
  150. backgroundColor: 'transparent',
  151. color: OVERLAY_FONT_COLOR,
  152. fontSize: 20
  153. },
  154. pullToRefreshText: {
  155. backgroundColor: 'transparent',
  156. color: OVERLAY_FONT_COLOR
  157. },
  158. secondaryActionContainer: {
  159. alignItems: 'center',
  160. backgroundColor: ColorPalette.blue,
  161. borderRadius: 3,
  162. height: SECONDARY_ACTION_BUTTON_SIZE,
  163. justifyContent: 'center',
  164. margin: BoxModel.margin * 0.5,
  165. marginRight: BoxModel.margin,
  166. width: SECONDARY_ACTION_BUTTON_SIZE
  167. },
  168. secondaryActionLabel: {
  169. color: ColorPalette.white
  170. },
  171. touchableView: {
  172. flexDirection: 'row'
  173. }
  174. };
  175. export const TINTED_VIEW_DEFAULT = {
  176. backgroundColor: ColorPalette.appBackground,
  177. opacity: 0.8
  178. };
  179. export const BASE_INDICATOR = {
  180. alignItems: 'center',
  181. justifyContent: 'center'
  182. };
  183. /**
  184. * The styles of the generic React {@code Component}s implemented by the feature
  185. * base/react.
  186. */
  187. export default {
  188. ...PAGED_LIST_STYLES,
  189. ...SECTION_LIST_STYLES
  190. };