Fix form keyboard issues and sticky footers in agent screens

This commit is contained in:
Abin Toppo
2026-05-26 16:34:05 +05:30
commit 9ac5e95d52
410 changed files with 86650 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
import React from 'react';
import {
DarkTheme,
NavigationContainer,
} from '@react-navigation/native';
import { useAppSelector } from '../app/hooks';
import { selectAuthHydrating, selectIsAuthenticated, selectAuthRole } from '../modules/auth/store/authSelectors';
import { useTheme } from '../theme';
import { AuthNavigator } from './AuthNavigator';
import { MainTabNavigator } from './MainTabNavigator';
import { EmployeeNavigator } from './EmployeeNavigator';
import { AgentNavigator } from './AgentNavigator';
export const RootNavigator = () => {
const theme = useTheme();
const isHydrating = useAppSelector(selectAuthHydrating);
const isAuthenticated = useAppSelector(selectIsAuthenticated);
const role = useAppSelector(selectAuthRole);
const renderAppStack = () => {
switch (role) {
case 'Employee':
return <EmployeeNavigator />;
case 'Agent':
return <AgentNavigator />;
case 'User':
default:
return <MainTabNavigator />;
}
};
return (
<NavigationContainer
theme={{
...DarkTheme,
colors: {
...DarkTheme.colors,
background: theme.colors.background,
card: theme.colors.backgroundElevated,
text: theme.colors.textPrimary,
primary: theme.colors.accent,
border: theme.colors.cardBorder,
notification: theme.colors.accent,
},
}}
>
{isAuthenticated ? renderAppStack() : <AuthNavigator />}
</NavigationContainer>
);
};