refactor: remove schedule from barber data and update navigation icons to use Ionicons
This commit is contained in:
@@ -441,7 +441,6 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
shop_id: shopId,
|
||||
name: barber.name,
|
||||
specialties: barber.specialties,
|
||||
schedule: barber.schedule || [],
|
||||
image_url: barber.imageUrl,
|
||||
}]);
|
||||
if (error) {
|
||||
@@ -455,7 +454,6 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
await supabase.from('barbers').update({
|
||||
name: barber.name,
|
||||
specialties: barber.specialties,
|
||||
schedule: barber.schedule,
|
||||
image_url: barber.imageUrl,
|
||||
}).eq('id', barber.id);
|
||||
await refreshShops();
|
||||
|
||||
@@ -3,6 +3,7 @@ import { NavigationContainer } from '@react-navigation/native';
|
||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||
import { View, Text, StyleSheet, Platform } from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import { useApp } from '../context/AppContext';
|
||||
import AuthLogin from '../pages/AuthLogin';
|
||||
import AuthRegister from '../pages/AuthRegister';
|
||||
@@ -17,9 +18,13 @@ import EventsCreate from '../pages/EventsCreate';
|
||||
const Stack = createNativeStackNavigator();
|
||||
const Tab = createBottomTabNavigator();
|
||||
|
||||
const TabIcon = ({ icon, focused }: { icon: string; focused: boolean }) => (
|
||||
const TabIcon = ({ name, focused }: { name: any; focused: boolean }) => (
|
||||
<View style={[iconStyles.wrap, focused && iconStyles.wrapActive]}>
|
||||
<Text style={iconStyles.emoji}>{icon}</Text>
|
||||
<Ionicons
|
||||
name={focused ? name : `${name}-outline`}
|
||||
size={20}
|
||||
color={focused ? '#a5b4fc' : '#475569'}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -70,7 +75,7 @@ function ClientTabs() {
|
||||
component={ExploreStack}
|
||||
options={{
|
||||
tabBarLabel: 'Explorar',
|
||||
tabBarIcon: ({ focused }) => <TabIcon icon="◉" focused={focused} />,
|
||||
tabBarIcon: ({ focused }) => <TabIcon name="search" focused={focused} />,
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
@@ -78,7 +83,7 @@ function ClientTabs() {
|
||||
component={CartStack}
|
||||
options={{
|
||||
tabBarLabel: 'Carrinho',
|
||||
tabBarIcon: ({ focused }) => <TabIcon icon="◫" focused={focused} />,
|
||||
tabBarIcon: ({ focused }) => <TabIcon name="cart" focused={focused} />,
|
||||
tabBarBadge: cart.length > 0 ? cart.length : undefined,
|
||||
tabBarBadgeStyle: tabStyles.badge,
|
||||
}}
|
||||
@@ -88,7 +93,7 @@ function ClientTabs() {
|
||||
component={ClientProfileStack}
|
||||
options={{
|
||||
tabBarLabel: 'Perfil',
|
||||
tabBarIcon: ({ focused }) => <TabIcon icon="◎" focused={focused} />,
|
||||
tabBarIcon: ({ focused }) => <TabIcon name="person" focused={focused} />,
|
||||
}}
|
||||
/>
|
||||
</Tab.Navigator>
|
||||
@@ -130,7 +135,7 @@ function BarbeariaTabs() {
|
||||
component={DashboardStack}
|
||||
options={{
|
||||
tabBarLabel: 'Painel',
|
||||
tabBarIcon: ({ focused }) => <TabIcon icon="▦" focused={focused} />,
|
||||
tabBarIcon: ({ focused }) => <TabIcon name="grid" focused={focused} />,
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
@@ -138,7 +143,7 @@ function BarbeariaTabs() {
|
||||
component={BarberProfileStack}
|
||||
options={{
|
||||
tabBarLabel: 'Perfil',
|
||||
tabBarIcon: ({ focused }) => <TabIcon icon="◎" focused={focused} />,
|
||||
tabBarIcon: ({ focused }) => <TabIcon name="person" focused={focused} />,
|
||||
}}
|
||||
/>
|
||||
</Tab.Navigator>
|
||||
|
||||
Reference in New Issue
Block a user