Pretty up code. Add all my default stuff that I like

This commit is contained in:
2025-01-28 10:17:33 -06:00
parent 5a821fc6b5
commit 0dfb7f190d
20 changed files with 191 additions and 182 deletions

View File

@@ -1,21 +1,23 @@
import { Tabs } from 'expo-router';
import React from 'react';
import { Platform } from 'react-native';
import { HapticTab } from '@/components/HapticTab';
import { HapticTab } from '@/components/default/HapticTab';
import { IconSymbol } from '@/components/ui/IconSymbol';
import TabBarBackground from '@/components/ui/TabBarBackground';
import { Colors } from '@/constants/Colors';
import { useColorScheme } from '@/hooks/useColorScheme';
export default function TabLayout() {
const colorScheme = useColorScheme();
const TabLayout = () => {
const scheme = useColorScheme() ?? 'dark';
return (
<Tabs
screenOptions={{
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
tabBarActiveTintColor: Colors[scheme].tint,
headerShown: false,
headerStyle: {
backgroundColor: Colors[scheme].background,
},
tabBarButton: HapticTab,
tabBarBackground: TabBarBackground,
tabBarStyle: Platform.select({
@@ -23,7 +25,11 @@ export default function TabLayout() {
// Use a transparent background on iOS to show the blur effect
position: 'absolute',
},
default: {},
default: {
backgroundColor: Colors[scheme].background,
borderTopColor: Colors[scheme].tint,
borderTopWidth: 1,
},
}),
}}
>
@@ -35,12 +41,13 @@ export default function TabLayout() {
}}
/>
<Tabs.Screen
name='explore'
name='settings'
options={{
title: 'Explore',
tabBarIcon: ({ color }) => <IconSymbol size={28} name='paperplane.fill' color={color} />,
title: 'Settings',
tabBarIcon: ({ color }) => <IconSymbol size={28} name='gearshape.fill' color={color} />,
}}
/>
</Tabs>
);
}
};
export default TabLayout;