fix(webapp): FCY/BCY typo

This commit is contained in:
a.bouhuolia
2023-04-20 06:10:25 +02:00
parent 8f039b77e7
commit cfbe4cfea0
3 changed files with 12 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ export function AccountDrawerTableHeader() {
setBCYCurrencyType, setBCYCurrencyType,
setFYCCurrencyType, setFYCCurrencyType,
isBCYCurrencyType, isBCYCurrencyType,
isFYCCurrencyType, isFCYCurrencyType,
} = useAccountDrawerTableOptionsContext(); } = useAccountDrawerTableOptionsContext();
const handleBCYBtnClick = () => { const handleBCYBtnClick = () => {
@@ -25,7 +25,7 @@ export function AccountDrawerTableHeader() {
small small
outlined outlined
onClick={handleFCYBtnClick} onClick={handleFCYBtnClick}
active={isFYCCurrencyType} active={isFCYCurrencyType}
> >
FCY FCY
</Button> </Button>

View File

@@ -3,7 +3,7 @@ import React, { useState, useCallback } from 'react';
interface AccountDrawerTableOptionsContextValue { interface AccountDrawerTableOptionsContextValue {
setFYCCurrencyType: () => void; setFYCCurrencyType: () => void;
setBCYCurrencyType: () => void; setBCYCurrencyType: () => void;
isFYCCurrencyType: boolean; isFCYCurrencyType: boolean;
isBCYCurrencyType: boolean; isBCYCurrencyType: boolean;
currencyType: ForeignCurrencyType; currencyType: ForeignCurrencyType;
} }
@@ -13,20 +13,20 @@ const AccountDrawerTableOptionsContext = React.createContext(
); );
enum ForeignCurrencyTypes { enum ForeignCurrencyTypes {
FYC = 'FYC', FCY = 'FCY',
BCY = 'BCY', BCY = 'BCY',
} }
type ForeignCurrencyType = ForeignCurrencyTypes.FYC | ForeignCurrencyTypes.BCY; type ForeignCurrencyType = ForeignCurrencyTypes.FCY | ForeignCurrencyTypes.BCY;
function AccountDrawerTableOptionsProvider({ function AccountDrawerTableOptionsProvider({
initialCurrencyType = ForeignCurrencyTypes.FYC, initialCurrencyType = ForeignCurrencyTypes.FCY,
...props ...props
}) { }) {
const [currencyType, setCurrentType] = const [currencyType, setCurrentType] =
useState<ForeignCurrencyType>(initialCurrencyType); useState<ForeignCurrencyType>(initialCurrencyType);
const setFYCCurrencyType = useCallback( const setFYCCurrencyType = useCallback(
() => setCurrentType(ForeignCurrencyTypes.FYC), () => setCurrentType(ForeignCurrencyTypes.FCY),
[setCurrentType], [setCurrentType],
); );
const setBCYCurrencyType = useCallback( const setBCYCurrencyType = useCallback(
@@ -38,7 +38,7 @@ function AccountDrawerTableOptionsProvider({
const provider = { const provider = {
setFYCCurrencyType, setFYCCurrencyType,
setBCYCurrencyType, setBCYCurrencyType,
isFYCCurrencyType: currencyType === ForeignCurrencyTypes.FYC, isFCYCurrencyType: currencyType === ForeignCurrencyTypes.FCY,
isBCYCurrencyType: currencyType === ForeignCurrencyTypes.BCY, isBCYCurrencyType: currencyType === ForeignCurrencyTypes.BCY,
currencyType, currencyType,
}; };

View File

@@ -9,7 +9,7 @@ import { useAccountDrawerTableOptionsContext } from './AccountDrawerTableOptions
* Retrieve entries columns of read-only account view. * Retrieve entries columns of read-only account view.
*/ */
export const useAccountReadEntriesColumns = () => { export const useAccountReadEntriesColumns = () => {
const { isFYCCurrencyType } = useAccountDrawerTableOptionsContext(); const { isFCYCurrencyType } = useAccountDrawerTableOptionsContext();
return React.useMemo( return React.useMemo(
() => [ () => [
@@ -28,7 +28,7 @@ export const useAccountReadEntriesColumns = () => {
}, },
{ {
Header: intl.get('credit'), Header: intl.get('credit'),
accessor: isFYCCurrencyType accessor: isFCYCurrencyType
? 'formatted_fc_credit' ? 'formatted_fc_credit'
: 'formatted_credit', : 'formatted_credit',
width: 80, width: 80,
@@ -38,13 +38,13 @@ export const useAccountReadEntriesColumns = () => {
}, },
{ {
Header: intl.get('debit'), Header: intl.get('debit'),
accessor: isFYCCurrencyType ? 'formatted_fc_debit' : 'formatted_debit', accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
width: 80, width: 80,
className: 'debit', className: 'debit',
align: 'right', align: 'right',
textOverview: true, textOverview: true,
}, },
], ],
[isFYCCurrencyType], [isFCYCurrencyType],
); );
}; };