Footer.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // @flow
  2. import variable from './../variables/platform';
  3. import { PLATFORM } from './../variables/commonColor';
  4. export default (variables /* : * */ = variable) => {
  5. const platformStyle = variables.platformStyle;
  6. const platform = variables.platform;
  7. const iconCommon = {
  8. 'NativeBase.Icon': {
  9. color: variables.tabBarActiveTextColor
  10. }
  11. };
  12. const iconNBCommon = {
  13. 'NativeBase.IconNB': {
  14. color: variables.tabBarActiveTextColor
  15. }
  16. };
  17. const textCommon = {
  18. 'NativeBase.Text': {
  19. color: variables.tabBarActiveTextColor
  20. }
  21. };
  22. const footerTheme = {
  23. 'NativeBase.Left': {
  24. 'NativeBase.Button': {
  25. '.transparent': {
  26. backgroundColor: 'transparent',
  27. borderColor: null,
  28. elevation: 0,
  29. shadowColor: null,
  30. shadowOffset: null,
  31. shadowRadius: null,
  32. shadowOpacity: null,
  33. ...iconCommon,
  34. ...iconNBCommon,
  35. ...textCommon
  36. },
  37. alignSelf: null,
  38. ...iconCommon,
  39. ...iconNBCommon
  40. // ...textCommon
  41. },
  42. flex: 1,
  43. alignSelf: 'center',
  44. alignItems: 'flex-start'
  45. },
  46. 'NativeBase.Body': {
  47. flex: 1,
  48. alignItems: 'center',
  49. alignSelf: 'center',
  50. flexDirection: 'row',
  51. 'NativeBase.Button': {
  52. alignSelf: 'center',
  53. '.transparent': {
  54. backgroundColor: 'transparent',
  55. borderColor: null,
  56. elevation: 0,
  57. shadowColor: null,
  58. shadowOffset: null,
  59. shadowRadius: null,
  60. shadowOpacity: null,
  61. ...iconCommon,
  62. ...iconNBCommon,
  63. ...textCommon
  64. },
  65. '.full': {
  66. height: variables.footerHeight,
  67. paddingBottom: variables.footerPaddingBottom,
  68. flex: 1
  69. },
  70. ...iconCommon,
  71. ...iconNBCommon
  72. // ...textCommon
  73. }
  74. },
  75. 'NativeBase.Right': {
  76. 'NativeBase.Button': {
  77. '.transparent': {
  78. backgroundColor: 'transparent',
  79. borderColor: null,
  80. elevation: 0,
  81. shadowColor: null,
  82. shadowOffset: null,
  83. shadowRadius: null,
  84. shadowOpacity: null,
  85. ...iconCommon,
  86. ...iconNBCommon,
  87. ...textCommon
  88. },
  89. alignSelf: null,
  90. ...iconCommon,
  91. ...iconNBCommon
  92. // ...textCommon
  93. },
  94. flex: 1,
  95. alignSelf: 'center',
  96. alignItems: 'flex-end'
  97. },
  98. backgroundColor: variables.footerDefaultBg,
  99. flexDirection: 'row',
  100. justifyContent: 'center',
  101. borderTopWidth:
  102. platform === PLATFORM.IOS && platformStyle !== PLATFORM.MATERIAL
  103. ? variables.borderWidth
  104. : undefined,
  105. borderColor:
  106. platform === PLATFORM.IOS && platformStyle !== PLATFORM.MATERIAL
  107. ? '#cbcbcb'
  108. : undefined,
  109. height: variables.footerHeight,
  110. paddingBottom: variables.footerPaddingBottom,
  111. elevation: 3,
  112. left: 0,
  113. right: 0
  114. };
  115. return footerTheme;
  116. };