Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
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.

CardItem.js 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. // @flow
  2. import { StyleSheet } from 'react-native';
  3. import variable from './../variables/platform';
  4. import { PLATFORM } from './../variables/commonColor';
  5. export default (variables /* : * */ = variable) => {
  6. const platform = variables.platform;
  7. const transparentBtnCommon = {
  8. 'NativeBase.Text': {
  9. fontSize: variables.DefaultFontSize - 3,
  10. color: variables.sTabBarActiveTextColor
  11. },
  12. 'NativeBase.Icon': {
  13. fontSize: variables.iconFontSize - 10,
  14. color: variables.sTabBarActiveTextColor,
  15. marginHorizontal: null
  16. },
  17. 'NativeBase.IconNB': {
  18. fontSize: variables.iconFontSize - 10,
  19. color: variables.sTabBarActiveTextColor
  20. },
  21. paddingVertical: null,
  22. paddingHorizontal: null
  23. };
  24. const cardItemTheme = {
  25. 'NativeBase.Left': {
  26. 'NativeBase.Body': {
  27. 'NativeBase.Text': {
  28. '.note': {
  29. color: variables.listNoteColor,
  30. fontWeight: '400',
  31. marginRight: 20
  32. }
  33. },
  34. flex: 1,
  35. marginLeft: 10,
  36. alignItems: null
  37. },
  38. 'NativeBase.Icon': {
  39. fontSize: variables.iconFontSize
  40. },
  41. 'NativeBase.IconNB': {
  42. fontSize: variables.iconFontSize
  43. },
  44. 'NativeBase.Text': {
  45. marginLeft: 10,
  46. alignSelf: 'center'
  47. },
  48. 'NativeBase.Button': {
  49. '.transparent': {
  50. ...transparentBtnCommon,
  51. paddingRight: variables.cardItemPadding + 5
  52. }
  53. },
  54. flex: 1,
  55. flexDirection: 'row',
  56. alignItems: 'center'
  57. },
  58. '.content': {
  59. 'NativeBase.Text': {
  60. color: platform === PLATFORM.IOS ? '#555' : '#222',
  61. fontSize: variables.DefaultFontSize - 2
  62. }
  63. },
  64. '.cardBody': {
  65. padding: -5,
  66. 'NativeBase.Text': {
  67. marginTop: 5
  68. }
  69. },
  70. 'NativeBase.Body': {
  71. 'NativeBase.Text': {
  72. '.note': {
  73. color: variables.listNoteColor,
  74. fontWeight: '200',
  75. marginRight: 20
  76. }
  77. },
  78. 'NativeBase.Button': {
  79. '.transparent': {
  80. ...transparentBtnCommon,
  81. paddingRight: variables.cardItemPadding + 5,
  82. alignSelf: 'stretch'
  83. }
  84. },
  85. flex: 1,
  86. alignSelf: 'stretch',
  87. alignItems: 'flex-start'
  88. },
  89. 'NativeBase.Right': {
  90. 'NativeBase.Badge': {
  91. alignSelf: null
  92. },
  93. 'NativeBase.Button': {
  94. '.transparent': {
  95. ...transparentBtnCommon
  96. },
  97. alignSelf: null
  98. },
  99. 'NativeBase.Icon': {
  100. alignSelf: null,
  101. fontSize: variables.iconFontSize - 8,
  102. color: variables.cardBorderColor
  103. },
  104. 'NativeBase.IconNB': {
  105. alignSelf: null,
  106. fontSize: variables.iconFontSize - 8,
  107. color: variables.cardBorderColor
  108. },
  109. 'NativeBase.Text': {
  110. fontSize: variables.DefaultFontSize - 1,
  111. alignSelf: null
  112. },
  113. 'NativeBase.Thumbnail': {
  114. alignSelf: null
  115. },
  116. 'NativeBase.Image': {
  117. alignSelf: null
  118. },
  119. 'NativeBase.Radio': {
  120. alignSelf: null
  121. },
  122. 'NativeBase.Checkbox': {
  123. alignSelf: null
  124. },
  125. 'NativeBase.Switch': {
  126. alignSelf: null
  127. },
  128. flex: 0.8
  129. },
  130. '.header': {
  131. 'NativeBase.Text': {
  132. fontSize: 16,
  133. fontWeight: platform === PLATFORM.IOS ? '600' : '500'
  134. },
  135. '.bordered': {
  136. 'NativeBase.Text': {
  137. color: variables.brandPrimary,
  138. fontWeight: platform === PLATFORM.IOS ? '600' : '500'
  139. },
  140. borderBottomWidth: variables.borderWidth
  141. },
  142. borderBottomWidth: null,
  143. paddingVertical: variables.cardItemPadding + 5
  144. },
  145. '.footer': {
  146. 'NativeBase.Text': {
  147. fontSize: 16,
  148. fontWeight: platform === PLATFORM.IOS ? '600' : '500'
  149. },
  150. '.bordered': {
  151. 'NativeBase.Text': {
  152. color: variables.brandPrimary,
  153. fontWeight: platform === PLATFORM.IOS ? '600' : '500'
  154. },
  155. borderTopWidth: variables.borderWidth
  156. },
  157. borderBottomWidth: null
  158. },
  159. 'NativeBase.Text': {
  160. '.note': {
  161. color: variables.listNoteColor,
  162. fontWeight: '200'
  163. }
  164. },
  165. 'NativeBase.Icon': {
  166. width: variables.iconFontSize + 5,
  167. fontSize: variables.iconFontSize - 2
  168. },
  169. 'NativeBase.IconNB': {
  170. width: variables.iconFontSize + 5,
  171. fontSize: variables.iconFontSize - 2
  172. },
  173. '.bordered': {
  174. borderBottomWidth: StyleSheet.hairlineWidth,
  175. borderColor: variables.cardBorderColor
  176. },
  177. '.first': {
  178. borderTopLeftRadius: variables.cardBorderRadius,
  179. borderTopRightRadius: variables.cardBorderRadius
  180. },
  181. '.last': {
  182. borderBottomLeftRadius: variables.cardBorderRadius,
  183. borderBottomRightRadius: variables.cardBorderRadius
  184. },
  185. flexDirection: 'row',
  186. alignItems: 'center',
  187. borderRadius: variables.cardBorderRadius,
  188. padding: variables.cardItemPadding + 5,
  189. paddingVertical: variables.cardItemPadding,
  190. backgroundColor: variables.cardDefaultBg
  191. };
  192. return cardItemTheme;
  193. };