From 313659689e1363bb6dc0623ed782258a70afee6f Mon Sep 17 00:00:00 2001 From: David Arranz Date: Wed, 28 Aug 2024 14:30:28 +0200 Subject: [PATCH] . --- .../src/app/quotes/components/QuoteResume.tsx | 38 ++------------- .../components/editors/QuoteStatusEditor.tsx | 48 +++++++++++-------- client/src/components/PDFViewer/PDFViewer.tsx | 19 +++++++- client/src/locales/en.json | 3 +- 4 files changed, 51 insertions(+), 57 deletions(-) diff --git a/client/src/app/quotes/components/QuoteResume.tsx b/client/src/app/quotes/components/QuoteResume.tsx index 6661585..44089d0 100644 --- a/client/src/app/quotes/components/QuoteResume.tsx +++ b/client/src/app/quotes/components/QuoteResume.tsx @@ -1,11 +1,4 @@ -import { - ChevronLeft, - ChevronRight, - CreditCard, - DownloadIcon, - FilePenLineIcon, - MoreVertical, -} from "lucide-react"; +import { CreditCard, DownloadIcon, FilePenLineIcon, MoreVertical } from "lucide-react"; import { cn } from "@/lib/utils"; import { @@ -19,11 +12,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, - DropdownMenuSeparator, DropdownMenuTrigger, - Pagination, - PaginationContent, - PaginationItem, Separator, Tabs, TabsContent, @@ -102,7 +91,7 @@ export const QuoteResume = ({ quoteId, className }: QuoteResumeProps) => { - + {`${t("quotes.list.preview.quote")} #${data.reference}`} @@ -141,7 +130,7 @@ export const QuoteResume = ({ quoteId, className }: QuoteResumeProps) => { - @@ -154,9 +143,6 @@ export const QuoteResume = ({ quoteId, className }: QuoteResumeProps) => { {t("quotes.list.preview.download_quote")} - Export - - Trash @@ -284,24 +270,8 @@ export const QuoteResume = ({ quoteId, className }: QuoteResumeProps) => { - +
Updated...
- - - - - - - - - -
diff --git a/client/src/app/quotes/components/editors/QuoteStatusEditor.tsx b/client/src/app/quotes/components/editors/QuoteStatusEditor.tsx index ba83899..d19247a 100644 --- a/client/src/app/quotes/components/editors/QuoteStatusEditor.tsx +++ b/client/src/app/quotes/components/editors/QuoteStatusEditor.tsx @@ -1,3 +1,4 @@ +import { cn } from "@/lib/utils"; import { Button, Dialog, @@ -71,29 +72,34 @@ export const QuoteStatusEditor = ({
- {QuoteStatus.map((_status) => ( -
- changeStatus(_status)} - disabled={ - !quoteStatusTransitions[quote.status as TQuoteStatus].includes( - _status as TQuoteStatus - ) - } - /> + {QuoteStatus.map((_status) => { + const isDisabled = !quoteStatusTransitions[quote.status as TQuoteStatus].includes( + _status as TQuoteStatus + ); -
- -

- {t(`quotes.quote_status_editor.status.${_status}.description`)} -

+ return ( +
+ changeStatus(_status)} + disabled={isDisabled} + /> + +
+ +

+ {t(`quotes.quote_status_editor.status.${_status}.description`)} +

+
-
- ))} + ); + })}
diff --git a/client/src/components/PDFViewer/PDFViewer.tsx b/client/src/components/PDFViewer/PDFViewer.tsx index a46aecc..8cc5ed1 100644 --- a/client/src/components/PDFViewer/PDFViewer.tsx +++ b/client/src/components/PDFViewer/PDFViewer.tsx @@ -1,5 +1,5 @@ import { cn } from "@/lib/utils"; -import { Button } from "@/ui"; +import { Button, Pagination, PaginationContent, PaginationItem } from "@/ui"; import { useResizeObserver } from "@wojtekmaj/react-hooks"; import { t } from "i18next"; import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"; @@ -132,6 +132,23 @@ export const PDFViewer = ({ file, onThumbnailClick, className }: PDFViewerProps) /> + + + + + + + + + + +