_layout.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import React from 'react';
  2. import { Tabs } from 'expo-router';
  3. import { Dimensions, Platform } from 'react-native';
  4. import {
  5. TabAccountIcon,
  6. TabChargingIcon,
  7. TabHomeIcon
  8. } from '../../../component/global/SVG';
  9. export default function TabLayout() {
  10. const { height } = Dimensions.get('window');
  11. return (
  12. <Tabs
  13. screenOptions={{
  14. headerShown: false,
  15. tabBarLabelStyle: {
  16. fontSize: 16,
  17. marginBottom: Platform.OS === 'ios' ? 0 : 25
  18. },
  19. tabBarStyle: {
  20. height: height * 0.105,
  21. }
  22. }}
  23. >
  24. <Tabs.Screen
  25. name="(home)"
  26. options={{
  27. title: '主頁',
  28. tabBarHideOnKeyboard: true,
  29. tabBarIcon: ({ focused }) => (
  30. <TabHomeIcon color={focused ? '#02677D' : '#BBBBBB'} />
  31. )
  32. }}
  33. />
  34. <Tabs.Screen
  35. name="(charging)/index"
  36. options={{
  37. title: '充電',
  38. tabBarHideOnKeyboard: true,
  39. tabBarIcon: ({ focused }) => (
  40. <TabChargingIcon
  41. color={focused ? '#02677D' : '#BBBBBB'}
  42. />
  43. )
  44. }}
  45. />
  46. <Tabs.Screen
  47. name="(account)"
  48. options={{
  49. title: '帳戶',
  50. tabBarHideOnKeyboard: true,
  51. tabBarIcon: ({ focused, color }) => (
  52. <TabAccountIcon
  53. color={focused ? '#02677D' : '#BBBBBB'}
  54. />
  55. )
  56. }}
  57. />
  58. </Tabs>
  59. );
  60. }