feat(fixed):bankdetails
This commit is contained in:
parent
1336de5770
commit
69b415c732
@ -9,7 +9,7 @@ import {
|
|||||||
import { useAppTheme } from '@theme';
|
import { useAppTheme } from '@theme';
|
||||||
import { ScreenHeader } from '@components';
|
import { ScreenHeader } from '@components';
|
||||||
import { WalletIcon, CheckCircleIcon, ClipboardIcon } from '@icons';
|
import { WalletIcon, CheckCircleIcon, ClipboardIcon } from '@icons';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
||||||
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
||||||
import { AppStackParamList } from '@navigation/navigationTypes';
|
import { AppStackParamList } from '@navigation/navigationTypes';
|
||||||
import { getStyles } from './bankDetailsScreen.styles';
|
import { getStyles } from './bankDetailsScreen.styles';
|
||||||
@ -42,7 +42,7 @@ export const BankDetailsScreen = () => {
|
|||||||
const navigation =
|
const navigation =
|
||||||
useNavigation<NativeStackNavigationProp<AppStackParamList>>();
|
useNavigation<NativeStackNavigationProp<AppStackParamList>>();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
const isFocused = useIsFocused();
|
||||||
|
|
||||||
// Replace this state with Redux selector when wiring real API
|
// Replace this state with Redux selector when wiring real API
|
||||||
// const [accounts] = useState<BankAccount[]>(bankAccounts);
|
// const [accounts] = useState<BankAccount[]>(bankAccounts);
|
||||||
@ -50,9 +50,10 @@ export const BankDetailsScreen = () => {
|
|||||||
// console.log('-------');
|
// console.log('-------');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(fetchBankAccounts());
|
if (isFocused) {
|
||||||
// console.log('object')
|
dispatch(fetchBankAccounts());
|
||||||
}, [dispatch]);
|
}
|
||||||
|
}, [dispatch, isFocused]);
|
||||||
|
|
||||||
const { bankAccounts, isLoading, error } = useAppSelector(
|
const { bankAccounts, isLoading, error } = useAppSelector(
|
||||||
state => state.addBankDetails,
|
state => state.addBankDetails,
|
||||||
|
|||||||
@ -36,11 +36,11 @@ export const ProfileScreen: React.FC = () => {
|
|||||||
icon: <ClipboardIcon size={20} color={colors.primary} />,
|
icon: <ClipboardIcon size={20} color={colors.primary} />,
|
||||||
route: RouteNames.BankDetails,
|
route: RouteNames.BankDetails,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 'emergency',
|
// id: 'emergency',
|
||||||
title: 'Emergency Contact',
|
// title: 'Emergency Contact',
|
||||||
icon: <PersonIcon size={20} color={colors.primary} />,
|
// icon: <PersonIcon size={20} color={colors.primary} />,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: 'settings',
|
id: 'settings',
|
||||||
title: 'App Settings',
|
title: 'App Settings',
|
||||||
|
|||||||
@ -82,11 +82,11 @@ const BottomTabNavigator: React.FC = () => {
|
|||||||
options={{ tabBarLabel: 'Jobs' }}
|
options={{ tabBarLabel: 'Jobs' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Tab.Screen
|
{/* <Tab.Screen
|
||||||
name={RouteNames.Inbox}
|
name={RouteNames.Inbox}
|
||||||
component={InboxScreen}
|
component={InboxScreen}
|
||||||
options={{ tabBarLabel: 'Inbox' }}
|
options={{ tabBarLabel: 'Inbox' }}
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
name={RouteNames.Profile}
|
name={RouteNames.Profile}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user