// Dependencies
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { ActivityIndicator } from 'react-native';
import { ThemeContext } from 'react-native-elements';
// Hoooks
import { useAuth } from 'react-native-chatting';
// AuthStack
import Auth from '@app/screens/auth';
// MainStack
import ChannelList from '@app/screens/main/ChannelList';
/**
* Stack react navigation.
*/
const Stack = createStackNavigator();
/**
* Defines the react native navigation for app.
* @returns The react app navigation component.
*/
export function Navigation(): React.ReactElement {
const { session, isInitAuth } = useAuth();
const { theme } = React.useContext(ThemeContext);
if (isInitAuth) {
return (
);
}
return (
{
session
?
:
}
);
}
export default Navigation;