您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

styles.js 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // @flow
  2. import { StyleSheet } from 'react-native';
  3. import { BoxModel, ColorPalette, createStyleSheet } from '../../../styles';
  4. import { PREFERRED_DIALOG_SIZE } from '../../constants';
  5. const BORDER_RADIUS = 5;
  6. const DIALOG_BORDER_COLOR = 'rgba(255, 255, 255, 0.2)';
  7. export const FIELD_UNDERLINE = ColorPalette.transparent;
  8. export const PLACEHOLDER_COLOR = ColorPalette.lightGrey;
  9. /**
  10. * The React {@code Component} styles of {@code BottomSheet}. These have
  11. * been implemented as per the Material Design guidelines:
  12. * {@link https://material.io/guidelines/components/bottom-sheets.html}.
  13. */
  14. export const bottomSheetStyles = createStyleSheet({
  15. /**
  16. * Style for a backdrop which dims the view in the background. This view
  17. * will also be clickable. The backgroundColor is applied to the overlay
  18. * view instead, so the modal animation doesn't affect the backdrop.
  19. */
  20. backdrop: {
  21. ...StyleSheet.absoluteFillObject
  22. },
  23. /**
  24. * Style for the container of the sheet.
  25. */
  26. container: {
  27. alignItems: 'flex-end',
  28. flex: 1,
  29. flexDirection: 'row',
  30. justifyContent: 'center'
  31. },
  32. /**
  33. * Style for an overlay on top of which the sheet will be displayed.
  34. */
  35. overlay: {
  36. ...StyleSheet.absoluteFillObject,
  37. backgroundColor: 'rgba(0, 0, 0, 0.8)'
  38. },
  39. /**
  40. * Bottom sheet's base style.
  41. */
  42. sheet: {
  43. backgroundColor: ColorPalette.white,
  44. flex: 1,
  45. paddingHorizontal: 16,
  46. paddingVertical: 8
  47. }
  48. });
  49. export const brandedDialog = createStyleSheet({
  50. /**
  51. * The style of bold {@code Text} rendered by the {@code Dialog}s of the
  52. * feature authentication.
  53. */
  54. boldDialogText: {
  55. fontWeight: 'bold'
  56. },
  57. button: {
  58. backgroundColor: ColorPalette.blue,
  59. flex: 1,
  60. padding: BoxModel.padding * 1.5
  61. },
  62. buttonFarLeft: {
  63. borderBottomLeftRadius: BORDER_RADIUS
  64. },
  65. buttonFarRight: {
  66. borderBottomRightRadius: BORDER_RADIUS
  67. },
  68. buttonSeparator: {
  69. borderRightColor: DIALOG_BORDER_COLOR,
  70. borderRightWidth: 1
  71. },
  72. buttonWrapper: {
  73. alignItems: 'stretch',
  74. borderRadius: BORDER_RADIUS,
  75. flexDirection: 'row'
  76. },
  77. closeStyle: {
  78. color: ColorPalette.white,
  79. fontSize: 16
  80. },
  81. closeWrapper: {
  82. alignSelf: 'flex-end',
  83. padding: BoxModel.padding
  84. },
  85. dialog: {
  86. alignItems: 'stretch',
  87. backgroundColor: 'rgb(0, 3, 6)',
  88. borderColor: DIALOG_BORDER_COLOR,
  89. borderRadius: BORDER_RADIUS,
  90. borderWidth: 1,
  91. flex: 1,
  92. flexDirection: 'column',
  93. maxWidth: PREFERRED_DIALOG_SIZE
  94. },
  95. mainWrapper: {
  96. alignSelf: 'stretch',
  97. padding: BoxModel.padding * 2,
  98. // The added bottom padding is to compensate the empty space around the
  99. // close icon.
  100. paddingBottom: BoxModel.padding * 3
  101. },
  102. overlay: {
  103. ...StyleSheet.absoluteFillObject,
  104. alignItems: 'center',
  105. backgroundColor: 'rgba(127, 127, 127, 0.6)',
  106. flexDirection: 'row',
  107. justifyContent: 'center',
  108. padding: 30
  109. },
  110. text: {
  111. color: ColorPalette.white,
  112. fontSize: 16,
  113. textAlign: 'center'
  114. }
  115. });
  116. /**
  117. * The React {@code Component} styles of {@code Dialog}.
  118. */
  119. export const dialog = createStyleSheet({
  120. /**
  121. * The style of the {@code Text} in a {@code Dialog} button.
  122. */
  123. buttonText: {
  124. color: ColorPalette.blue
  125. },
  126. /**
  127. * The style of the {@code Text} in a {@code Dialog} button which is
  128. * disabled.
  129. */
  130. disabledButtonText: {
  131. color: ColorPalette.darkGrey
  132. }
  133. });
  134. export const inputDialog = createStyleSheet({
  135. bottomField: {
  136. marginBottom: 0
  137. },
  138. field: {
  139. ...brandedDialog.text,
  140. borderBottomWidth: 1,
  141. borderColor: DIALOG_BORDER_COLOR,
  142. margin: BoxModel.margin,
  143. textAlign: 'left'
  144. },
  145. fieldLabel: {
  146. ...brandedDialog.text,
  147. margin: BoxModel.margin,
  148. textAlign: 'left'
  149. },
  150. fieldWrapper: {
  151. ...brandedDialog.mainWrapper,
  152. paddingBottom: BoxModel.padding * 2
  153. }
  154. });