fix: content tweaks in rates re-calc popover

This commit is contained in:
Ahmed Bouhuolia
2024-01-14 15:59:25 +02:00
parent 2b03ac7f16
commit 1e4b29f83c
2 changed files with 20 additions and 22 deletions

View File

@@ -8,6 +8,7 @@ import {
ControlGroup, ControlGroup,
Intent, Intent,
Popover, Popover,
Position,
Spinner, Spinner,
} from '@blueprintjs/core'; } from '@blueprintjs/core';
import { FlagIcon } from '../Tags'; import { FlagIcon } from '../Tags';
@@ -106,15 +107,22 @@ export function ExchangeRateInputGroup({
const popoverConfirmContent = ( const popoverConfirmContent = (
<PopoverContent> <PopoverContent>
<p> <p>
Are you want to re-calculate item prices based on this exchange rate Are you want to re-calculate item prices based on this exchange rate.
</p> </p>
<div <div
style={{ style={{
display: 'flex', display: 'flex',
justifyContent: 'flex-end',
marginTop: 15, marginTop: 15,
}} }}
> >
<Button
intent={Intent.WARNING}
className={Classes.POPOVER_DISMISS}
onClick={handleRecalcConfirmBtn}
small
>
Calculate
</Button>
<Button <Button
className={Classes.POPOVER_DISMISS} className={Classes.POPOVER_DISMISS}
style={{ marginRight: 10 }} style={{ marginRight: 10 }}
@@ -124,14 +132,6 @@ export function ExchangeRateInputGroup({
> >
Cancel Cancel
</Button> </Button>
<Button
intent={Intent.WARNING}
className={Classes.POPOVER_DISMISS}
onClick={handleRecalcConfirmBtn}
small
>
Re-calculate
</Button>
</div> </div>
</PopoverContent> </PopoverContent>
); );
@@ -144,7 +144,11 @@ export function ExchangeRateInputGroup({
</ExchangeRatePrepend> </ExchangeRatePrepend>
{withPopoverRecalcConfirm ? ( {withPopoverRecalcConfirm ? (
<Popover isOpen={isOpen} content={popoverConfirmContent}> <Popover
isOpen={isOpen}
content={popoverConfirmContent}
position={Position.RIGHT}
>
{exchangeRateField} {exchangeRateField}
</Popover> </Popover>
) : ( ) : (

View File

@@ -10,9 +10,7 @@ import { Button, Classes, Intent } from '@blueprintjs/core';
*/ */
function InvoiceExchangeRateChangeDialog({ function InvoiceExchangeRateChangeDialog({
dialogName, dialogName,
payload: { initialFormValues },
isOpen, isOpen,
onConfirm,
// #withDialogActions // #withDialogActions
closeDialog, closeDialog,
}) { }) {
@@ -23,6 +21,7 @@ function InvoiceExchangeRateChangeDialog({
return ( return (
<Dialog <Dialog
name={dialogName} name={dialogName}
title={'Kindly take care of new rates'}
autoFocus={true} autoFocus={true}
canEscapeKeyClose={true} canEscapeKeyClose={true}
isOpen={isOpen} isOpen={isOpen}
@@ -31,18 +30,13 @@ function InvoiceExchangeRateChangeDialog({
<DialogSuspense> <DialogSuspense>
<div className={Classes.DIALOG_BODY}> <div className={Classes.DIALOG_BODY}>
<p> <p>
You have changed customer's currency after adding items to the The item rates have been <strong>adjusted</strong> to the new
Invoice. currency using realtime exchange rate.
</p>
<p>
The item rates have been adjusted to the new currency using exchange
rate feeds.
</p> </p>
<p style={{ marginBottom: '30px' }}> <p style={{ marginBottom: '30px' }}>
Before saving the transaction, ensure that the item rates align with Make sure to check that the item rates match the current exchange
the current exchange rate of the newly selected currency. rate of the newly selected currency before saving the transaction.
</p> </p>
</div> </div>