react-native-navigation的迁移库

SimpleLayouts.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. const singleScreenApp = {
  2. container: {
  3. name: 'com.example.MyScreen'
  4. }
  5. };
  6. const passProps = {
  7. strProp: 'string prop',
  8. numProp: 12345,
  9. objProp: { inner: { foo: 'bar' } },
  10. fnProp: () => 'Hello from a function'
  11. };
  12. const singleScreenWithAditionalParams = {
  13. container: {
  14. name: 'com.example.MyScreen',
  15. passProps,
  16. style: {},
  17. buttons: {}
  18. }
  19. };
  20. const tabBasedApp = {
  21. bottomTabs: [
  22. {
  23. container: {
  24. name: 'com.example.ATab'
  25. }
  26. },
  27. {
  28. container: {
  29. name: 'com.example.SecondTab'
  30. }
  31. },
  32. {
  33. container: {
  34. name: 'com.example.ATab'
  35. }
  36. }
  37. ]
  38. };
  39. const singleWithSideMenu = {
  40. container: {
  41. name: 'com.example.MyScreen'
  42. },
  43. sideMenu: {
  44. left: {
  45. container: {
  46. name: 'com.example.SideMenu'
  47. }
  48. }
  49. }
  50. };
  51. const singleWithRightSideMenu = {
  52. container: {
  53. name: 'com.example.MyScreen'
  54. },
  55. sideMenu: {
  56. right: {
  57. container: {
  58. name: 'com.example.SideMenu'
  59. }
  60. }
  61. }
  62. };
  63. const singleWithBothMenus = {
  64. container: {
  65. name: 'com.example.MyScreen'
  66. },
  67. sideMenu: {
  68. left: {
  69. container: {
  70. name: 'com.example.Menu1'
  71. }
  72. },
  73. right: {
  74. container: {
  75. name: 'com.example.Menu2'
  76. }
  77. }
  78. }
  79. };
  80. const tabBasedWithBothSideMenus = {
  81. bottomTabs: [
  82. {
  83. container: {
  84. name: 'com.example.FirstTab'
  85. }
  86. },
  87. {
  88. container: {
  89. name: 'com.example.SecondTab'
  90. }
  91. }
  92. ],
  93. sideMenu: {
  94. left: {
  95. container: {
  96. name: 'com.example.Menu1'
  97. }
  98. },
  99. right: {
  100. container: {
  101. name: 'com.example.Menu2'
  102. }
  103. }
  104. }
  105. };
  106. const singleScreenWithTopTabs = {
  107. topTabs: [
  108. {
  109. name: 'navigation.playground.TextScreen'
  110. },
  111. {
  112. name: 'navigation.playground.TextScreen'
  113. },
  114. {
  115. name: 'navigation.playground.TextScreen'
  116. }
  117. ]
  118. };
  119. module.exports = {
  120. singleScreenApp,
  121. passProps,
  122. singleScreenWithAditionalParams,
  123. tabBasedApp,
  124. singleWithSideMenu,
  125. singleWithRightSideMenu,
  126. singleWithBothMenus,
  127. tabBasedWithBothSideMenus,
  128. singleScreenWithTopTabs
  129. };