feat(cashflow): add exchange rate muted.

This commit is contained in:
elforjani13
2022-03-06 23:26:09 +02:00
parent 7467b63e54
commit a639101e28
7 changed files with 30 additions and 22 deletions

View File

@@ -29,16 +29,15 @@ export function ExchangeRateMutedField({
if (isEqual(toCurrency, fromCurrency) && !isUndefined(toCurrency)) { if (isEqual(toCurrency, fromCurrency) && !isUndefined(toCurrency)) {
return null; return null;
} }
const content = ( const content = (
<Menu> <ExchangeRateFormGroupContent>
<ExchangeRateInputGroup <ExchangeRateInputGroup
name={name} name={name}
fromCurrency={fromCurrency} fromCurrency={fromCurrency}
toCurrency={toCurrency} toCurrency={toCurrency}
{...ExchangeRateprops} {...ExchangeRateprops}
/> />
</Menu> </ExchangeRateFormGroupContent>
); );
return ( return (
@@ -53,12 +52,16 @@ export function ExchangeRateMutedField({
offset: { offset: '0, 4' }, offset: { offset: '0, 4' },
}} }}
minimal={true} minimal={true}
usePortal={false}
target={<div />}
> >
<ExchangeRateButton <ExchangeRateButton>
1 {fromCurrency} = {exchangeRate} {toCurrency}
<Button
className={Classes.MINIMAL} className={Classes.MINIMAL}
rightIcon={<Icon icon="pen-18" />} rightIcon={<Icon icon="pen-18" />}
> small={true}
1 {fromCurrency} = {exchangeRate} {toCurrency} />
</ExchangeRateButton> </ExchangeRateButton>
</Popover> </Popover>
</ExchangeRateFormGroup> </ExchangeRateFormGroup>
@@ -69,16 +72,21 @@ const ExchangeRateFormGroup = styled(FormGroup)`
.bp3-label { .bp3-label {
font-size: 12px !important; font-size: 12px !important;
opacity: 0.7; opacity: 0.7;
line-height: 0.1rem; line-height: 0.5rem;
} }
`; `;
const ExchangeRateButton = styled(Button)` const ExchangeRateButton = styled.div`
.bp3-button-text {
display: flex; display: flex;
align-items: center;
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 500;
color: #0d244a; color: #0d244a;
} `;
padding: 0;
const ExchangeRateFormGroupContent = styled.div`
.bp3-form-group {
padding: 2px;
margin: 2px 4px !important;
}
`; `;

View File

@@ -112,8 +112,8 @@ function OtherIncomeFormFields({
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</FeatureCan>
<BranchRowDivider /> <BranchRowDivider />
</FeatureCan>
<Row> <Row>
<Col xs={5}> <Col xs={5}>

View File

@@ -112,8 +112,8 @@ function OwnerContributionFormFields({
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</FeatureCan>
<BranchRowDivider /> <BranchRowDivider />
</FeatureCan>
<Row> <Row>
<Col xs={5}> <Col xs={5}>
{/*------------ Date -----------*/} {/*------------ Date -----------*/}

View File

@@ -110,8 +110,8 @@ function TransferFromAccountFormFields({
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</FeatureCan>
<BranchRowDivider /> <BranchRowDivider />
</FeatureCan>
<Row> <Row>
<Col xs={5}> <Col xs={5}>
{/*------------ Date -----------*/} {/*------------ Date -----------*/}

View File

@@ -111,8 +111,8 @@ function OtherExpnseFormFields({
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</FeatureCan>
<BranchRowDivider /> <BranchRowDivider />
</FeatureCan>
<Row> <Row>
<Col xs={5}> <Col xs={5}>
{/*------------ Date -----------*/} {/*------------ Date -----------*/}

View File

@@ -109,8 +109,8 @@ function OwnerDrawingsFormFields({
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</FeatureCan>
<BranchRowDivider /> <BranchRowDivider />
</FeatureCan>
<Row> <Row>
<Col xs={5}> <Col xs={5}>
{/*------------ Date -----------*/} {/*------------ Date -----------*/}

View File

@@ -110,8 +110,8 @@ function TransferToAccountFormFields({
</FormGroup> </FormGroup>
</Col> </Col>
</Row> </Row>
</FeatureCan>
<BranchRowDivider /> <BranchRowDivider />
</FeatureCan>
<Row> <Row>
<Col xs={5}> <Col xs={5}>
{/*------------ Date -----------*/} {/*------------ Date -----------*/}