Skip to content

Commit

Permalink
solucionando problemas con las barra de navegacion
Browse files Browse the repository at this point in the history
  • Loading branch information
dotM87 committed Apr 12, 2024
1 parent 9a0e114 commit dbf6607
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/assets/Theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const theme = {
primaryText: "#161819",
secondaryText: "#787878",
primary: "#fffefd",
primary: "#E5EAEE",
primary: "#ffffff",
secondary: "#bbe6ec",
secondary: "#9DBBE2",
tertiary: "#152432",
Expand Down
103 changes: 51 additions & 52 deletions src/navigation/AppNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ProfileScreen from '../screens/ProfileScreen';
import HistoryScreen from '../screens/HistoryScreen';
import OthersScreen from '../screens/OthersScreen';
import Icon from 'react-native-vector-icons/Ionicons';
import { theme } from '../../constants';
import { theme } from '../assets/Theme';

const Stack = createNativeStackNavigator();

Expand All @@ -26,59 +26,15 @@ const TabIcon = ({ name, color, size }) => {

function AppNavigator() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={{
tabBarActiveTintColor: theme.colors.tertiary,
tabBarInactiveTintColor: theme.colors.slateGrey,
headerShown: false,
}}
>
<Tab.Screen
name="Inicio"
component={StackNavigator}
options={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => (
<TabIcon name={focused ? 'home' : 'home-outline'} color={color} size={size}/>

),
})}
/>
<Tab.Screen
name="Historial"
component={HistoryScreen}
options={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => (
<TabIcon name={focused ? 'newspaper' : 'newspaper-outline'} color={color} size={size} />
),
tabBarBadge: 3, //borrar
})}
/>
<Tab.Screen
name="Otros"
component={OthersScreen}
options={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => (
<TabIcon name={focused ? 'menu' : 'menu-outline'} color={color} size={size} />
),
})}
/>
</Tab.Navigator>
</NavigationContainer>
);
}

function StackNavigator() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="NewScreen"
screenOptions={{
animationEnabled: false,
headerShown: false,
}}
>
screenOptions={{
animationEnabled: false,
headerShown: false,
}}>
<Stack.Screen
name="NewScreen"
component={NewScreen}
component={TabNavigator}
/>
<Stack.Screen
name="ClientSearchScreen"
Expand Down Expand Up @@ -108,7 +64,50 @@ function StackNavigator() {
name='ProfileScreen'
component={ProfileScreen}
/>
</Stack.Navigator>
</Stack.Navigator>
</NavigationContainer>
);
}

function TabNavigator() {
return (
<Tab.Navigator
screenOptions={{
tabBarActiveTintColor: theme.colors.tertiary,
tabBarInactiveTintColor: theme.colors.slateGrey,
headerShown: false,
}}
>
<Tab.Screen
name="Inicio"
component={NewScreen}
options={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => (
<TabIcon name={focused ? 'home' : 'home-outline'} color={color} size={size}/>

),
})}
/>
<Tab.Screen
name="Historial"
component={HistoryScreen}
options={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => (
<TabIcon name={focused ? 'newspaper' : 'newspaper-outline'} color={color} size={size} />
),
tabBarBadge: 3, //borrar
})}
/>
<Tab.Screen
name="Otros"
component={OthersScreen}
options={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => (
<TabIcon name={focused ? 'menu' : 'menu-outline'} color={color} size={size} />
),
})}
/>
</Tab.Navigator>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/screens/HistoryScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { StatusBar } from 'expo-status-bar';
import { theme } from '../../constants';
import { theme } from '../assets/Theme';

const OthersScreen = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/screens/OthersScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import { StatusBar } from 'expo-status-bar';
import { theme } from '../../constants';
import { theme } from '../assets/Theme';

const OthersScreen = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/utils/StyledText.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Text, StyleSheet, Dimensions } from 'react-native';
import { theme } from "../assets/Theme";
const { height } = Dimensions.get('window');

const regularTextSize = height * 0.025
const regularTextSize = height * 0.024
const bigTextSize = height * 0.025
const grandbigText = height * 0.04

Expand Down

0 comments on commit dbf6607

Please sign in to comment.