Item.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. // @flow
  2. import { Platform } from 'react-native';
  3. import variable from './../variables/platform';
  4. import { PLATFORM } from './../variables/commonColor';
  5. export default (variables /* : * */ = variable) => {
  6. const itemTheme = {
  7. '.floatingLabel': {
  8. 'NativeBase.Input': {
  9. height: 50,
  10. top: 8,
  11. paddingTop: 3,
  12. paddingBottom: 7,
  13. '.multiline': {
  14. minHeight: variables.inputHeightBase,
  15. paddingTop: Platform.OS === PLATFORM.IOS ? 10 : 3,
  16. paddingBottom: Platform.OS === PLATFORM.IOS ? 14 : 10
  17. }
  18. },
  19. 'NativeBase.Label': {
  20. paddingTop: 5
  21. },
  22. 'NativeBase.Icon': {
  23. top: 6,
  24. paddingTop: 8
  25. },
  26. 'NativeBase.IconNB': {
  27. top: 6,
  28. paddingTop: 8
  29. }
  30. },
  31. '.fixedLabel': {
  32. 'NativeBase.Label': {
  33. position: null,
  34. top: null,
  35. left: null,
  36. right: null,
  37. flex: 1,
  38. height: null,
  39. width: null,
  40. fontSize: variables.inputFontSize
  41. },
  42. 'NativeBase.Input': {
  43. flex: 2,
  44. fontSize: variables.inputFontSize
  45. }
  46. },
  47. '.stackedLabel': {
  48. 'NativeBase.Label': {
  49. position: null,
  50. top: null,
  51. left: null,
  52. right: null,
  53. paddingTop: 5,
  54. alignSelf: 'flex-start',
  55. fontSize: variables.inputFontSize - 2
  56. },
  57. 'NativeBase.Icon': {
  58. marginTop: 36
  59. },
  60. 'NativeBase.Input': {
  61. // alignSelf: Platform.OS === PLATFORM.IOS ? 'stretch' : 'flex-start',
  62. alignSelf: 'stretch',
  63. flex: 1,
  64. // width: Platform.OS === PLATFORM.IOS ? null : variables.deviceWidth - 25,
  65. fontSize: variables.inputFontSize,
  66. lineHeight: variables.inputLineHeight - 6,
  67. '.secureTextEntry': {
  68. fontSize: variables.inputFontSize
  69. },
  70. '.multiline': {
  71. paddingTop: Platform.OS === PLATFORM.IOS ? 9 : undefined,
  72. paddingBottom: Platform.OS === PLATFORM.IOS ? 9 : undefined
  73. }
  74. },
  75. flexDirection: null,
  76. minHeight: variables.inputHeightBase + 15
  77. },
  78. '.inlineLabel': {
  79. 'NativeBase.Label': {
  80. position: null,
  81. top: null,
  82. left: null,
  83. right: null,
  84. paddingRight: 20,
  85. height: null,
  86. width: null,
  87. fontSize: variables.inputFontSize
  88. },
  89. 'NativeBase.Input': {
  90. paddingLeft: 5,
  91. fontSize: variables.inputFontSize
  92. },
  93. flexDirection: 'row'
  94. },
  95. 'NativeBase.Label': {
  96. fontSize: variables.inputFontSize,
  97. color: variables.inputColorPlaceholder,
  98. paddingRight: 5
  99. },
  100. 'NativeBase.Icon': {
  101. fontSize: 24,
  102. paddingRight: 8
  103. },
  104. 'NativeBase.IconNB': {
  105. fontSize: 24,
  106. paddingRight: 8
  107. },
  108. 'NativeBase.Input': {
  109. '.multiline': {
  110. height: null
  111. },
  112. height: variables.inputHeightBase,
  113. color: variables.inputColor,
  114. flex: 1,
  115. top: Platform.OS === PLATFORM.IOS ? 1.5 : undefined,
  116. fontSize: variables.inputFontSize
  117. },
  118. '.underline': {
  119. 'NativeBase.Input': {
  120. paddingLeft: 15
  121. },
  122. '.success': {
  123. borderColor: variables.inputSuccessBorderColor
  124. },
  125. '.error': {
  126. borderColor: variables.inputErrorBorderColor
  127. },
  128. borderWidth: variables.borderWidth * 2,
  129. borderTopWidth: 0,
  130. borderRightWidth: 0,
  131. borderLeftWidth: 0,
  132. borderColor: variables.inputBorderColor
  133. },
  134. '.regular': {
  135. 'NativeBase.Input': {
  136. paddingLeft: 8
  137. },
  138. 'NativeBase.Icon': {
  139. paddingLeft: 10
  140. },
  141. '.success': {
  142. borderColor: variables.inputSuccessBorderColor
  143. },
  144. '.error': {
  145. borderColor: variables.inputErrorBorderColor
  146. },
  147. borderWidth: variables.borderWidth * 2,
  148. borderColor: variables.inputBorderColor
  149. },
  150. '.rounded': {
  151. 'NativeBase.Input': {
  152. paddingLeft: 8
  153. },
  154. 'NativeBase.Icon': {
  155. paddingLeft: 10
  156. },
  157. '.success': {
  158. borderColor: variables.inputSuccessBorderColor
  159. },
  160. '.error': {
  161. borderColor: variables.inputErrorBorderColor
  162. },
  163. borderWidth: variables.borderWidth * 2,
  164. borderRadius: 30,
  165. borderColor: variables.inputBorderColor
  166. },
  167. '.success': {
  168. 'NativeBase.Icon': {
  169. color: variables.inputSuccessBorderColor
  170. },
  171. 'NativeBase.IconNB': {
  172. color: variables.inputSuccessBorderColor
  173. },
  174. '.rounded': {
  175. borderRadius: 30,
  176. borderColor: variables.inputSuccessBorderColor
  177. },
  178. '.regular': {
  179. borderColor: variables.inputSuccessBorderColor
  180. },
  181. '.underline': {
  182. borderWidth: variables.borderWidth * 2,
  183. borderTopWidth: 0,
  184. borderRightWidth: 0,
  185. borderLeftWidth: 0,
  186. borderColor: variables.inputSuccessBorderColor
  187. },
  188. borderColor: variables.inputSuccessBorderColor
  189. },
  190. '.error': {
  191. 'NativeBase.Icon': {
  192. color: variables.inputErrorBorderColor
  193. },
  194. 'NativeBase.IconNB': {
  195. color: variables.inputErrorBorderColor
  196. },
  197. '.rounded': {
  198. borderRadius: 30,
  199. borderColor: variables.inputErrorBorderColor
  200. },
  201. '.regular': {
  202. borderColor: variables.inputErrorBorderColor
  203. },
  204. '.underline': {
  205. borderWidth: variables.borderWidth * 2,
  206. borderTopWidth: 0,
  207. borderRightWidth: 0,
  208. borderLeftWidth: 0,
  209. borderColor: variables.inputErrorBorderColor
  210. },
  211. borderColor: variables.inputErrorBorderColor
  212. },
  213. '.disabled': {
  214. 'NativeBase.Icon': {
  215. color: '#384850'
  216. },
  217. 'NativeBase.IconNB': {
  218. color: '#384850'
  219. }
  220. },
  221. '.picker': {
  222. marginLeft: 0
  223. },
  224. borderWidth: variables.borderWidth * 2,
  225. borderTopWidth: 0,
  226. borderRightWidth: 0,
  227. borderLeftWidth: 0,
  228. borderColor: variables.inputBorderColor,
  229. backgroundColor: 'transparent',
  230. flexDirection: 'row',
  231. alignItems: 'center',
  232. marginLeft: 2
  233. };
  234. return itemTheme;
  235. };