Skip to content

Commit 769e24d

Browse files
Fixed nativeAuth (#101)
* Fixed nativeAuth * Updated nativeAuth * Removed unused import * Updated showLabel param
1 parent c4f1cf5 commit 769e24d

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

src/app/dashboard/widgets/NativeAuth/NativeAuth.tsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,16 @@ import { OutputContainer } from '@/components/OutputContainer';
66

77
import {
88
useGetLoginInfo,
9-
useGetNetworkConfig,
10-
MvxFormatAmount,
11-
FormatAmountController,
12-
DIGITS,
13-
DECIMALS
9+
useGetAccount,
10+
FormatAmount
1411
} from '@/lib';
1512
import { useGetProfile } from './hooks';
1613
import { Username } from '../Account/components';
1714

1815
export const NativeAuth = () => {
1916
const { tokenLogin, isLoggedIn } = useGetLoginInfo();
17+
const { balance } = useGetAccount();
2018
const { isLoading, profile, getProfile } = useGetProfile();
21-
const { network } = useGetNetworkConfig();
22-
23-
const { isValid, valueDecimal, valueInteger, label } =
24-
FormatAmountController.getData({
25-
digits: DIGITS,
26-
decimals: DECIMALS,
27-
egldLabel: network.egldLabel,
28-
input: profile?.balance ?? '0'
29-
});
3019

3120
useEffect(() => {
3221
// On page refresh, tokenInfo is null which implies that we do not have access to loginInfo data
@@ -62,12 +51,10 @@ export const NativeAuth = () => {
6251

6352
<div className='flex gap-1'>
6453
<Label>Balance:</Label>
65-
<MvxFormatAmount
66-
isValid={isValid}
67-
valueDecimal={valueDecimal}
68-
valueInteger={valueInteger}
69-
label={label}
54+
<FormatAmount
55+
value={balance}
7056
data-testid='balance'
57+
showLabel
7158
/>
7259
</div>
7360
</OutputContainer>

0 commit comments

Comments
 (0)