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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. import {
  2. BoxModel,
  3. ColorPalette,
  4. createStyleSheet
  5. } from '../../../styles';
  6. const AVATAR_OPACITY = 0.4;
  7. const AVATAR_SIZE = 65;
  8. const HEADER_COLOR = ColorPalette.blue;
  9. // Header height is from iOS guidelines. Also, this looks good.
  10. const HEADER_HEIGHT = 44;
  11. const OVERLAY_FONT_COLOR = 'rgba(255, 255, 255, 0.6)';
  12. export const HEADER_PADDING = BoxModel.padding;
  13. export const STATUSBAR_COLOR = ColorPalette.blueHighlight;
  14. export const SIDEBAR_WIDTH = 250;
  15. export const UNDERLAY_COLOR = 'rgba(255, 255, 255, 0.2)';
  16. const HEADER_STYLES = {
  17. /**
  18. * Platform specific header button (e.g. back, menu...etc).
  19. */
  20. headerButton: {
  21. alignSelf: 'center',
  22. color: ColorPalette.white,
  23. fontSize: 26,
  24. paddingRight: 22
  25. },
  26. /**
  27. * Style of the header overlay to cover the unsafe areas.
  28. */
  29. headerOverlay: {
  30. backgroundColor: HEADER_COLOR
  31. },
  32. /**
  33. * Generic style for a label placed in the header.
  34. */
  35. headerText: {
  36. color: ColorPalette.white,
  37. fontSize: 20
  38. },
  39. /**
  40. * The top-level element of a page.
  41. */
  42. page: {
  43. alignItems: 'stretch',
  44. bottom: 0,
  45. flex: 1,
  46. flexDirection: 'column',
  47. left: 0,
  48. overflow: 'hidden',
  49. position: 'absolute',
  50. right: 0,
  51. top: 0
  52. },
  53. /**
  54. * Base style of Header
  55. */
  56. screenHeader: {
  57. alignItems: 'center',
  58. backgroundColor: HEADER_COLOR,
  59. flexDirection: 'row',
  60. height: HEADER_HEIGHT,
  61. justifyContent: 'flex-start',
  62. padding: HEADER_PADDING
  63. }
  64. };
  65. const SECTION_LIST_STYLES = {
  66. /**
  67. * The style of the actual avatar.
  68. */
  69. avatar: {
  70. alignItems: 'center',
  71. backgroundColor: `rgba(23, 160, 219, ${AVATAR_OPACITY})`,
  72. borderRadius: AVATAR_SIZE,
  73. height: AVATAR_SIZE,
  74. justifyContent: 'center',
  75. width: AVATAR_SIZE
  76. },
  77. /**
  78. * List of styles of the avatar of a remote meeting (not the default
  79. * server). The number of colors are limited because they should match
  80. * nicely.
  81. */
  82. avatarColor1: {
  83. backgroundColor: `rgba(232, 105, 156, ${AVATAR_OPACITY})`
  84. },
  85. avatarColor2: {
  86. backgroundColor: `rgba(255, 198, 115, ${AVATAR_OPACITY})`
  87. },
  88. avatarColor3: {
  89. backgroundColor: `rgba(128, 128, 255, ${AVATAR_OPACITY})`
  90. },
  91. avatarColor4: {
  92. backgroundColor: `rgba(105, 232, 194, ${AVATAR_OPACITY})`
  93. },
  94. avatarColor5: {
  95. backgroundColor: `rgba(234, 255, 128, ${AVATAR_OPACITY})`
  96. },
  97. /**
  98. * The style of the avatar container that makes the avatar rounded.
  99. */
  100. avatarContainer: {
  101. alignItems: 'center',
  102. flexDirection: 'row',
  103. justifyContent: 'space-around',
  104. padding: 5
  105. },
  106. /**
  107. * Simple {@code Text} content of the avatar (the actual initials).
  108. */
  109. avatarContent: {
  110. backgroundColor: 'rgba(0, 0, 0, 0)',
  111. color: OVERLAY_FONT_COLOR,
  112. fontSize: 32,
  113. fontWeight: '100',
  114. textAlign: 'center'
  115. },
  116. /**
  117. * The top level container style of the list.
  118. */
  119. container: {
  120. flex: 1
  121. },
  122. list: {
  123. flex: 1,
  124. flexDirection: 'column'
  125. },
  126. listItem: {
  127. alignItems: 'center',
  128. flex: 1,
  129. flexDirection: 'row',
  130. paddingVertical: 5
  131. },
  132. listItemDetails: {
  133. flex: 1,
  134. flexDirection: 'column',
  135. overflow: 'hidden',
  136. paddingHorizontal: 5
  137. },
  138. listItemText: {
  139. color: OVERLAY_FONT_COLOR,
  140. fontSize: 14
  141. },
  142. listItemTitle: {
  143. fontWeight: 'bold',
  144. fontSize: 16
  145. },
  146. listSection: {
  147. alignItems: 'center',
  148. backgroundColor: 'rgba(255, 255, 255, 0.2)',
  149. flex: 1,
  150. flexDirection: 'row',
  151. padding: 5
  152. },
  153. listSectionText: {
  154. color: OVERLAY_FONT_COLOR,
  155. fontSize: 14,
  156. fontWeight: 'normal'
  157. },
  158. touchableView: {
  159. flexDirection: 'row'
  160. }
  161. };
  162. const SIDEBAR_STYLES = {
  163. /**
  164. * The topmost container of the side bar.
  165. */
  166. sideMenuContainer: {
  167. bottom: 0,
  168. flexDirection: 'row',
  169. left: -SIDEBAR_WIDTH,
  170. position: 'absolute',
  171. top: 0,
  172. width: SIDEBAR_WIDTH
  173. },
  174. /**
  175. * The container of the actual content of the side menu.
  176. */
  177. sideMenuContent: {
  178. width: SIDEBAR_WIDTH
  179. },
  180. /**
  181. * The opaque area that covers the rest of the scren, when
  182. * the side bar is open.
  183. */
  184. sideMenuShadow: {
  185. backgroundColor: 'rgba(0, 0, 0, 0.5)',
  186. flex: 1
  187. },
  188. /**
  189. * The touchable area of the rest of the screen that closes the side bar
  190. * when tapped.
  191. */
  192. sideMenuShadowTouchable: {
  193. flex: 1
  194. }
  195. };
  196. /**
  197. * The styles of the React {@code Components} of the generic components
  198. * in the app.
  199. */
  200. export default createStyleSheet({
  201. ...HEADER_STYLES,
  202. ...SECTION_LIST_STYLES,
  203. ...SIDEBAR_STYLES
  204. });