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