Item.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. flex: 1,
  63. width: Platform.OS === PLATFORM.IOS ? null : variables.deviceWidth - 25,
  64. fontSize: variables.inputFontSize,
  65. lineHeight: variables.inputLineHeight - 6,
  66. '.secureTextEntry': {
  67. fontSize: variables.inputFontSize
  68. },
  69. '.multiline': {
  70. paddingTop: Platform.OS === PLATFORM.IOS ? 9 : undefined,
  71. paddingBottom: Platform.OS === PLATFORM.IOS ? 9 : undefined
  72. }
  73. },
  74. flexDirection: null,
  75. minHeight: variables.inputHeightBase + 15
  76. },
  77. '.inlineLabel': {
  78. 'NativeBase.Label': {
  79. position: null,
  80. top: null,
  81. left: null,
  82. right: null,
  83. paddingRight: 20,
  84. height: null,
  85. width: null,
  86. fontSize: variables.inputFontSize
  87. },
  88. 'NativeBase.Input': {
  89. paddingLeft: 5,
  90. fontSize: variables.inputFontSize
  91. },
  92. flexDirection: 'row'
  93. },
  94. 'NativeBase.Label': {
  95. fontSize: variables.inputFontSize,
  96. color: variables.inputColorPlaceholder,
  97. paddingRight: 5
  98. },
  99. 'NativeBase.Icon': {
  100. fontSize: 24,
  101. paddingRight: 8
  102. },
  103. 'NativeBase.IconNB': {
  104. fontSize: 24,
  105. paddingRight: 8
  106. },
  107. 'NativeBase.Input': {
  108. '.multiline': {
  109. height: null
  110. },
  111. height: variables.inputHeightBase,
  112. color: variables.inputColor,
  113. flex: 1,
  114. top: Platform.OS === PLATFORM.IOS ? 1.5 : undefined,
  115. fontSize: variables.inputFontSize
  116. },
  117. '.underline': {
  118. 'NativeBase.Input': {
  119. paddingLeft: 15
  120. },
  121. '.success': {
  122. borderColor: variables.inputSuccessBorderColor
  123. },
  124. '.error': {
  125. borderColor: variables.inputErrorBorderColor
  126. },
  127. borderWidth: variables.borderWidth * 2,
  128. borderTopWidth: 0,
  129. borderRightWidth: 0,
  130. borderLeftWidth: 0,
  131. borderColor: variables.inputBorderColor
  132. },
  133. '.regular': {
  134. 'NativeBase.Input': {
  135. paddingLeft: 8
  136. },
  137. 'NativeBase.Icon': {
  138. paddingLeft: 10
  139. },
  140. '.success': {
  141. borderColor: variables.inputSuccessBorderColor
  142. },
  143. '.error': {
  144. borderColor: variables.inputErrorBorderColor
  145. },
  146. borderWidth: variables.borderWidth * 2,
  147. borderColor: variables.inputBorderColor
  148. },
  149. '.rounded': {
  150. 'NativeBase.Input': {
  151. paddingLeft: 8
  152. },
  153. 'NativeBase.Icon': {
  154. paddingLeft: 10
  155. },
  156. '.success': {
  157. borderColor: variables.inputSuccessBorderColor
  158. },
  159. '.error': {
  160. borderColor: variables.inputErrorBorderColor
  161. },
  162. borderWidth: variables.borderWidth * 2,
  163. borderRadius: 30,
  164. borderColor: variables.inputBorderColor
  165. },
  166. '.success': {
  167. 'NativeBase.Icon': {
  168. color: variables.inputSuccessBorderColor
  169. },
  170. 'NativeBase.IconNB': {
  171. color: variables.inputSuccessBorderColor
  172. },
  173. '.rounded': {
  174. borderRadius: 30,
  175. borderColor: variables.inputSuccessBorderColor
  176. },
  177. '.regular': {
  178. borderColor: variables.inputSuccessBorderColor
  179. },
  180. '.underline': {
  181. borderWidth: variables.borderWidth * 2,
  182. borderTopWidth: 0,
  183. borderRightWidth: 0,
  184. borderLeftWidth: 0,
  185. borderColor: variables.inputSuccessBorderColor
  186. },
  187. borderColor: variables.inputSuccessBorderColor
  188. },
  189. '.error': {
  190. 'NativeBase.Icon': {
  191. color: variables.inputErrorBorderColor
  192. },
  193. 'NativeBase.IconNB': {
  194. color: variables.inputErrorBorderColor
  195. },
  196. '.rounded': {
  197. borderRadius: 30,
  198. borderColor: variables.inputErrorBorderColor
  199. },
  200. '.regular': {
  201. borderColor: variables.inputErrorBorderColor
  202. },
  203. '.underline': {
  204. borderWidth: variables.borderWidth * 2,
  205. borderTopWidth: 0,
  206. borderRightWidth: 0,
  207. borderLeftWidth: 0,
  208. borderColor: variables.inputErrorBorderColor
  209. },
  210. borderColor: variables.inputErrorBorderColor
  211. },
  212. '.disabled': {
  213. 'NativeBase.Icon': {
  214. color: '#384850'
  215. },
  216. 'NativeBase.IconNB': {
  217. color: '#384850'
  218. }
  219. },
  220. '.picker': {
  221. marginLeft: 0
  222. },
  223. borderWidth: variables.borderWidth * 2,
  224. borderTopWidth: 0,
  225. borderRightWidth: 0,
  226. borderLeftWidth: 0,
  227. borderColor: variables.inputBorderColor,
  228. backgroundColor: 'transparent',
  229. flexDirection: 'row',
  230. alignItems: 'center',
  231. marginLeft: 2
  232. };
  233. return itemTheme;
  234. };