Skip to content

Commit

Permalink
+ fix tab nav error (sales inspector)
Browse files Browse the repository at this point in the history
  • Loading branch information
jv-aquino committed Feb 18, 2025
1 parent d8b36c5 commit fd42d82
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/routes/TabNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const TabNav: React.FC<TabNavProps> = ({ route, user }) => {
} finally {
setLoading(false);
}
} else {
setLoading(false);
}
};

Expand All @@ -64,6 +66,10 @@ const TabNav: React.FC<TabNavProps> = ({ route, user }) => {
tabBarVisible: stage === screenName || screenName === 'Vendedores',
});

if (loading) {
return <LoadingIndicator />;
}

return (
<View style={{ flex: 1 }}>
<SalesInspector route={route} />
Expand Down Expand Up @@ -126,6 +132,9 @@ const TabNav: React.FC<TabNavProps> = ({ route, user }) => {
)}
</Tab.Screen>
)}
{!(stage === 'Mentoria' || stage === 'Visita' || cargo === 'Vendedor' || (cargo === 'Supervisor' && user.job === 'Gerente')) && (
<Tab.Screen name="Placeholder" component={NoInfoMessage} />
)}
</Tab.Navigator>
</S.Container>
</View>
Expand All @@ -144,6 +153,12 @@ const NoDataMessage: React.FC = () => (
</View>
);

const NoInfoMessage: React.FC = () => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={{ fontSize: 18 }}>Sem informações</Text>
</View>
);

const CardItem: React.FC<{ seller: ISeller }> = ({ seller }) => {
const fullName = seller.name || 'Usuário';
const nameParts = fullName.split(' ');
Expand Down

0 comments on commit fd42d82

Please sign in to comment.