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

View File

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

View File

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