Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ local.properties
.cxx/
*.keystore
!debug.keystore
.kotlin/

# node.js
#
Expand Down
2 changes: 0 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: true,
singleQuote: true,
trailingComma: 'all',
};
925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.4.1.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

4 changes: 0 additions & 4 deletions App/Actions/Keys/UserKey.ts

This file was deleted.

1 change: 0 additions & 1 deletion App/Actions/Keys/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions App/Actions/UserActions.ts

This file was deleted.

1 change: 0 additions & 1 deletion App/Actions/index.ts

This file was deleted.

1 change: 1 addition & 0 deletions App/AppContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, {
Context,
createContext,
JSX,
useContext,
useEffect,
useMemo,
Expand Down
10 changes: 10 additions & 0 deletions App/Hooks/Navigation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { RouteProp, useNavigation, useRoute } from '@react-navigation/native';
import { RouteType, StackNavigation } from '@Routes/AppRoutes';

export const useAppNavigation = () => {
return useNavigation<StackNavigation>();
};

export const useAppRoute = <T extends keyof RouteType>() => {
return useRoute<RouteProp<RouteType, T>>();
};
1 change: 1 addition & 0 deletions App/Hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Navigation';
12 changes: 0 additions & 12 deletions App/Localization/de.ts

This file was deleted.

12 changes: 0 additions & 12 deletions App/Localization/en.ts

This file was deleted.

12 changes: 0 additions & 12 deletions App/Localization/hi.ts

This file was deleted.

40 changes: 0 additions & 40 deletions App/Localization/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions App/Reducers/Default/index.ts

This file was deleted.

16 changes: 0 additions & 16 deletions App/Reducers/UserReducer.ts

This file was deleted.

6 changes: 0 additions & 6 deletions App/Reducers/index.ts

This file was deleted.

13 changes: 12 additions & 1 deletion App/Routes/AppRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import Login from '@Components/Login/Login';
import { AppTab } from '@Routes/AppTab';
import { StackNavigationProp } from '@react-navigation/stack';
import { AppTab, tabs } from '@Routes/AppTab';

enum Route {
LoginScreen = 'Login',
HomeScreen = 'Home',
}

export type RouteType = {
[Route.LoginScreen]: undefined;
[Route.HomeScreen]: {
screen: tabs;
params?: any;
};
};

export type StackNavigation = StackNavigationProp<RouteType>;

const Routes = [
{
name: Route.LoginScreen,
Expand Down
24 changes: 16 additions & 8 deletions App/Routes/AppTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import { Image } from 'react-native';
import {
BottomTabNavigationOptions,
BottomTabNavigationProp,
createBottomTabNavigator,
} from '@react-navigation/bottom-tabs';
import Home from '@Components/Home/Home';
Expand All @@ -12,7 +13,7 @@ import SettingsStack from '@Routes/SettingsStack';
import { AppImages } from '@Theme';
import { useAppContext } from '@AppContext';

const Tab = createBottomTabNavigator();
const Tab = createBottomTabNavigator<TabRouteType>();

enum tabs {
HomeTab = 'Home',
Expand All @@ -26,28 +27,37 @@ const TABS = [
title: tabs.HomeTab,
icon: AppImages.home,
screen: Home,
name: 'home',
name: tabs.HomeTab,
},
{
title: tabs.SearchTab,
icon: AppImages.search,
screen: Search,
name: 'search',
name: tabs.SearchTab,
},
{
title: tabs.UsersTab,
icon: AppImages.user,
screen: Users,
name: 'user',
name: tabs.UsersTab,
},
{
title: tabs.SettingsTab,
icon: AppImages.settings,
screen: SettingsStack,
name: 'setting',
name: tabs.SettingsTab,
},
];

type TabRouteType = {
[tabs.HomeTab]: undefined;
[tabs.SearchTab]: undefined;
[tabs.UsersTab]: undefined;
[tabs.SettingsTab]: undefined;
};

export type BottomTabNavigation = BottomTabNavigationProp<TabRouteType>;

const AppTab = () => {
const { appTheme } = useAppContext();
return (
Expand All @@ -60,9 +70,7 @@ const AppTab = () => {
backgroundColor: appTheme.tab,
},
}}
sceneContainerStyle={{
backgroundColor: appTheme.background,
}}>
>
{TABS.map(tab => {
return (
<Tab.Screen
Expand Down
11 changes: 6 additions & 5 deletions App/Routes/RootStack.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useEffect } from 'react';
import { DeviceEventEmitter, EmitterSubscription } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { Route, Routes } from '@Routes/AppRoutes';
import { Route, Routes, RouteType } from '@Routes/AppRoutes';
import { isLoggedIn } from '@Services';
import { Authentication, onLogout } from '@Utils';
import { useAppNavigation } from '@Hooks';

const Stack = createStackNavigator();
const Stack = createStackNavigator<RouteType>();

const RootStack = () => {
let isLogout: EmitterSubscription | null = null;
const navigation = useNavigation();
const navigation = useAppNavigation();

const isUserLogin = () => {
const isUserLoggedIn = isLoggedIn();
Expand Down Expand Up @@ -39,7 +39,8 @@ const RootStack = () => {
cardOverlayEnabled: true,
headerBackTitleVisible: false,
presentation: 'card',
})}>
})}
>
{Routes.map(route => {
return (
<Stack.Screen
Expand Down
9 changes: 3 additions & 6 deletions App/Routes/SettingsStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import Settings from '@Components/Settings/Settings';
import { useAppContext } from '@AppContext';
import { I18n } from '@Localization';

const Stack = createStackNavigator();

Expand All @@ -22,14 +21,12 @@ const SettingsStack = () => {
backgroundColor: appTheme.tab,
},
presentation: 'card',
})}>
})}
>
<Stack.Screen
name="Settings"
component={Settings}
options={{
title: I18n.t('SETTINGS'),
headerShown: true,
}}
options={{ headerShown: true }}
/>
</Stack.Navigator>
);
Expand Down
7 changes: 0 additions & 7 deletions App/Sagas/UserSaga.ts

This file was deleted.

7 changes: 0 additions & 7 deletions App/Sagas/index.ts

This file was deleted.

Loading
Loading