diff --git a/frontend/src/components/Dialogs/OrderDescription.tsx b/frontend/src/components/Dialogs/OrderDescription.tsx new file mode 100644 index 00000000..1c3ca10e --- /dev/null +++ b/frontend/src/components/Dialogs/OrderDescription.tsx @@ -0,0 +1,49 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { + Dialog, + DialogTitle, + DialogActions, + DialogContent, + DialogContentText, + Button, + Grid, +} from '@mui/material'; +import { Order } from '../../models'; + +interface Props { + open: boolean; + onClose: () => void; + onClickBack: () => void; + onClickDone: () => void; + order: Order; +} + +const OrderDescriptionDialog = ({ + open, + onClose, + onClickBack, + onClickDone, + order, +}: Props): React.JSX.Element => { + const { t } = useTranslation(); + + return ( + + {t('Order description')} + + + + {t('{{description}}', { description: order?.description })} + + + + + + + + + ); +}; + +export default OrderDescriptionDialog; diff --git a/frontend/src/components/Dialogs/index.ts b/frontend/src/components/Dialogs/index.ts index 2baab88b..90b7a5b4 100644 --- a/frontend/src/components/Dialogs/index.ts +++ b/frontend/src/components/Dialogs/index.ts @@ -14,3 +14,4 @@ export { default as F2fMapDialog } from './F2fMap'; export { default as UpdateDialog } from './Update'; export { default as WarningDialog } from './Warning'; export { default as DeleteRobotConfirmationDialog } from './DeleteRobotConfirmation'; +export { default as OrderDescriptionDialog } from './OrderDescription'; \ No newline at end of file diff --git a/frontend/src/components/OrderDetails/TakeButton.tsx b/frontend/src/components/OrderDetails/TakeButton.tsx index 22ed0bf5..ec5f2f88 100644 --- a/frontend/src/components/OrderDetails/TakeButton.tsx +++ b/frontend/src/components/OrderDetails/TakeButton.tsx @@ -21,7 +21,7 @@ import Countdown from 'react-countdown'; import currencies from '../../../static/assets/currencies.json'; import { type Order, type Info } from '../../models'; -import { ConfirmationDialog } from '../Dialogs'; +import { ConfirmationDialog, OrderDescriptionDialog } from '../Dialogs'; import { LoadingButton } from '@mui/lab'; import { computeSats } from '../../utils'; import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; @@ -40,9 +40,10 @@ interface TakeButtonProps { interface OpenDialogsProps { inactiveMaker: boolean; + description: boolean; confirmation: boolean; } -const closeAll = { inactiveMaker: false, confirmation: false }; +const closeAll = { inactiveMaker: false, description: false, confirmation: false }; const TakeButton = ({ password, @@ -117,7 +118,7 @@ const TakeButton = ({