mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
fix(webapp): FCY/BCY typo
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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],
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user