mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat(ExchangeRateInput): depend on currency code instead of country code.
This commit is contained in:
@@ -12,14 +12,11 @@ export function ExchangeRateInputGroup({
|
|||||||
formGroupProps,
|
formGroupProps,
|
||||||
name,
|
name,
|
||||||
}) {
|
}) {
|
||||||
const fromCountryCode = 'US';
|
|
||||||
const toCountryCode = 'LY';
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FFormGroup inline={true} {...formGroupProps} name={name}>
|
<FFormGroup inline={true} {...formGroupProps} name={name}>
|
||||||
<ControlGroup>
|
<ControlGroup>
|
||||||
<ExchangeRatePrepend>
|
<ExchangeRatePrepend>
|
||||||
<ExchangeFlagIcon countryCode={fromCountryCode} /> 1 {fromCurrency} =
|
<ExchangeFlagIcon currencyCode={fromCurrency} /> 1 {fromCurrency} =
|
||||||
</ExchangeRatePrepend>
|
</ExchangeRatePrepend>
|
||||||
<ExchangeRateField
|
<ExchangeRateField
|
||||||
allowDecimals={true}
|
allowDecimals={true}
|
||||||
@@ -28,7 +25,7 @@ export function ExchangeRateInputGroup({
|
|||||||
name={name}
|
name={name}
|
||||||
/>
|
/>
|
||||||
<ExchangeRateAppend>
|
<ExchangeRateAppend>
|
||||||
<ExchangeFlagIcon countryCode={toCountryCode} /> {toCurrency}
|
<ExchangeFlagIcon currencyCode={toCurrency} /> {toCurrency}
|
||||||
</ExchangeRateAppend>
|
</ExchangeRateAppend>
|
||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
Checkbox,
|
Checkbox,
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
Switch,
|
Switch,
|
||||||
|
EditableText,
|
||||||
} from '@blueprintjs-formik/core';
|
} from '@blueprintjs-formik/core';
|
||||||
import { Select, MultiSelect } from '@blueprintjs-formik/select';
|
import { Select, MultiSelect } from '@blueprintjs-formik/select';
|
||||||
|
|
||||||
@@ -17,4 +18,5 @@ export {
|
|||||||
Switch as FSwitch,
|
Switch as FSwitch,
|
||||||
Select as FSelect,
|
Select as FSelect,
|
||||||
MultiSelect as FMultiSelect,
|
MultiSelect as FMultiSelect,
|
||||||
|
EditableText as FEditableText,
|
||||||
};
|
};
|
||||||
|
|||||||
1
src/components/Paper/index.js
Normal file
1
src/components/Paper/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './Paper';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export const FlagIcon = ({ countryCode, className }) => {
|
export const FlagIcon = ({ currencyCode, className }) => {
|
||||||
const source = `/icons/flags/${countryCode}.svg`;
|
const source = `/icons/flags/${currencyCode}.svg`;
|
||||||
|
|
||||||
return <img alt="flag" src={source} className={className} />;
|
return <img alt="flag" src={source} className={className} />;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ function ItemsEntriesTable({
|
|||||||
defaultEntry,
|
defaultEntry,
|
||||||
errors,
|
errors,
|
||||||
onUpdateData,
|
onUpdateData,
|
||||||
linesNumber,
|
|
||||||
currencyCode,
|
currencyCode,
|
||||||
itemType, // sellable or purchasable
|
itemType, // sellable or purchasable
|
||||||
landedCost = false,
|
landedCost = false,
|
||||||
@@ -95,7 +94,6 @@ function ItemsEntriesTable({
|
|||||||
progressBarLoading={isItemFetching}
|
progressBarLoading={isItemFetching}
|
||||||
cellsLoading={isItemFetching}
|
cellsLoading={isItemFetching}
|
||||||
cellsLoadingCoords={cellsLoading}
|
cellsLoadingCoords={cellsLoading}
|
||||||
footer={true}
|
|
||||||
payload={{
|
payload={{
|
||||||
items,
|
items,
|
||||||
errors: errors || [],
|
errors: errors || [],
|
||||||
@@ -118,7 +116,7 @@ ItemsEntriesTable.defaultProps = {
|
|||||||
discount: '',
|
discount: '',
|
||||||
},
|
},
|
||||||
initialEntries: [],
|
initialEntries: [],
|
||||||
linesNumber: 4,
|
linesNumber: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ItemsEntriesTable;
|
export default ItemsEntriesTable;
|
||||||
|
|||||||
Reference in New Issue
Block a user