react-native-navigation的迁移库

Examples.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. const passProps = {
  2. strProp: 'string prop',
  3. numProp: 12345,
  4. objProp: { inner: { foo: 'bar' } },
  5. fnProp: () => 'Hello from a function'
  6. };
  7. const topBarOptions = {
  8. topBar: {
  9. title: 'Hello1'
  10. }
  11. };
  12. const singleComponent = {
  13. component: {
  14. name: 'MyReactComponent'
  15. }
  16. };
  17. const stackOfComponentsWithTopBar = {
  18. stack: [
  19. {
  20. component: {
  21. name: 'MyReactComponent1'
  22. }
  23. },
  24. {
  25. component: {
  26. name: 'MyReactComponent2',
  27. options: topBarOptions // optional
  28. }
  29. }
  30. ]
  31. };
  32. const bottomTabs = {
  33. bottomTabs: [
  34. stackOfComponentsWithTopBar,
  35. stackOfComponentsWithTopBar,
  36. {
  37. component: {
  38. name: 'MyReactComponent1'
  39. }
  40. }
  41. ]
  42. };
  43. const sideMenu = {
  44. sideMenu: {
  45. left: singleComponent,
  46. center: stackOfComponentsWithTopBar,
  47. right: singleComponent
  48. }
  49. };
  50. const topTabs = {
  51. topTabs: [
  52. singleComponent,
  53. singleComponent,
  54. singleComponent,
  55. singleComponent,
  56. stackOfComponentsWithTopBar
  57. ]
  58. };
  59. const complexLayout = {
  60. sideMenu: {
  61. left: singleComponent,
  62. center: {
  63. bottomTabs: [
  64. stackOfComponentsWithTopBar,
  65. stackOfComponentsWithTopBar,
  66. {
  67. stack: [
  68. {
  69. topTabs: [
  70. stackOfComponentsWithTopBar,
  71. stackOfComponentsWithTopBar,
  72. {
  73. topTabs: [
  74. singleComponent,
  75. singleComponent,
  76. singleComponent,
  77. singleComponent,
  78. stackOfComponentsWithTopBar
  79. ],
  80. options: topBarOptions
  81. }
  82. ]
  83. }
  84. ]
  85. }
  86. ]
  87. }
  88. }
  89. };
  90. module.exports = {
  91. passProps,
  92. topBarOptions,
  93. singleComponent,
  94. stackOfComponentsWithTopBar,
  95. bottomTabs,
  96. sideMenu,
  97. topTabs,
  98. complexLayout
  99. };