From e807cf51d47214204bbe54922de53382c07f38cb Mon Sep 17 00:00:00 2001 From: Ivan Di Luccio Date: Thu, 3 Oct 2024 11:54:21 +0200 Subject: [PATCH 1/3] bug: back from notice deatail, retry on error and notice SessionStorage --- src/components/PaymentNotice/Card.tsx | 7 ++++--- src/components/PaymentNotice/Error.tsx | 7 ++++++- src/routes/PaymentNotices/index.tsx | 13 ++++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/PaymentNotice/Card.tsx b/src/components/PaymentNotice/Card.tsx index 21e59bd1..1fc0bff8 100644 --- a/src/components/PaymentNotice/Card.tsx +++ b/src/components/PaymentNotice/Card.tsx @@ -41,7 +41,8 @@ export const _Card = (notice: PaymentNoticeType) => { const navigate = useNavigate(); const { setState } = useStore(); - function viewDetail() { + function viewDetail(e: React.MouseEvent) { + e.stopPropagation(); setState(STATE.PAYMENT_NOTICE, notice); navigate(`${ArcRoutes.PAYMENT_NOTICES}${iupd}`); } @@ -51,7 +52,7 @@ export const _Card = (notice: PaymentNoticeType) => { viewDetail()} + onClick={viewDetail} borderRadius={1} padding={3} gap={3} @@ -80,7 +81,7 @@ export const _Card = (notice: PaymentNoticeType) => { /> )} - viewDetail()}> + diff --git a/src/components/PaymentNotice/Error.tsx b/src/components/PaymentNotice/Error.tsx index cc04231f..d117795b 100644 --- a/src/components/PaymentNotice/Error.tsx +++ b/src/components/PaymentNotice/Error.tsx @@ -5,6 +5,10 @@ import { useTranslation } from 'react-i18next'; import { Box, Button, Card, CardActions } from '@mui/material'; import { ErrorOutline } from '@mui/icons-material'; +interface ErrorProps { + onRetry: () => void; +} + /** * This component is considered private and should not be used directly. * Instead, use `PaymentNotice.Error` for rendering the card. @@ -12,7 +16,7 @@ import { ErrorOutline } from '@mui/icons-material'; * @component * @private */ -export const _Error = () => { +export const _Error = (props: ErrorProps) => { const { t } = useTranslation(); return ( { {t('app.paymentNotice.error.description')}