From 6b0cc93b72571afad59ea4018cd62ecef18f4bd2 Mon Sep 17 00:00:00 2001 From: aniketceminds Date: Wed, 11 Dec 2024 13:32:46 +0530 Subject: [PATCH] fix(open-spark): modified code to fix cosmetci UI and code level bugs --- .../components/deviceList/AddNewDerModal.tsx | 12 ++++-------- .../components/dragAndDropUpload/index.tsx | 5 +++-- apps/open-spark/pages/index.tsx | 2 +- apps/open-spark/pages/myCredentials.tsx | 1 + apps/open-spark/pages/tradeDetails.tsx | 7 +------ .../order-status-progress.types.ts | 2 +- .../src/components/typography/typography.types.ts | 2 +- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/apps/open-spark/components/deviceList/AddNewDerModal.tsx b/apps/open-spark/components/deviceList/AddNewDerModal.tsx index 20c5b8fbd..2e97f5cd4 100644 --- a/apps/open-spark/components/deviceList/AddNewDerModal.tsx +++ b/apps/open-spark/components/deviceList/AddNewDerModal.tsx @@ -6,7 +6,7 @@ import { Box, Flex, Image } from '@chakra-ui/react' import uploadIcon from '@public/images/upload_icon.svg' import pdfIcon from '@public/images/PDF.svg' import DragAndDropUpload from '@components/dragAndDropUpload' -import RenderDocuments from '@components/documentsRenderer' +import RenderDocuments, { DocumentProps } from '@components/documentsRenderer' interface Proofs { id: number @@ -14,13 +14,6 @@ interface Proofs { date: string } -interface DocumentProps { - icon: string - title: string - file: any - date: Date -} - interface AddNewDerModalProps { isOpen: boolean onClose: () => void @@ -94,6 +87,8 @@ const AddNewDerModal = (props: AddNewDerModalProps) => { flexDir="column" > setCategory(e.target.value)} @@ -113,6 +108,7 @@ const AddNewDerModal = (props: AddNewDerModalProps) => { /> { return ( diff --git a/apps/open-spark/components/dragAndDropUpload/index.tsx b/apps/open-spark/components/dragAndDropUpload/index.tsx index ff6950314..b3b341909 100644 --- a/apps/open-spark/components/dragAndDropUpload/index.tsx +++ b/apps/open-spark/components/dragAndDropUpload/index.tsx @@ -10,10 +10,11 @@ interface DragAndDropUploadProps { inputRef: React.MutableRefObject ) => React.ReactElement | null setFiles: (files: File[]) => void + accept?: string } const DragAndDropUpload = (props: DragAndDropUploadProps) => { - const { fileSelectionElement, multiple, setFiles, dragAndDrop = false } = props + const { fileSelectionElement, multiple, setFiles, dragAndDrop = false, accept } = props const [isDragging, setIsDragging] = useState(false) const fileInputRef = useRef(null) @@ -68,7 +69,7 @@ const DragAndDropUpload = (props: DragAndDropUploadProps) => { { diff --git a/apps/open-spark/pages/myCredentials.tsx b/apps/open-spark/pages/myCredentials.tsx index 8caf33ad6..795972867 100644 --- a/apps/open-spark/pages/myCredentials.tsx +++ b/apps/open-spark/pages/myCredentials.tsx @@ -178,6 +178,7 @@ const MyCredentials = () => { { diff --git a/apps/open-spark/pages/tradeDetails.tsx b/apps/open-spark/pages/tradeDetails.tsx index 1c398c80c..531b53004 100644 --- a/apps/open-spark/pages/tradeDetails.tsx +++ b/apps/open-spark/pages/tradeDetails.tsx @@ -23,11 +23,6 @@ interface TradeMetaData { preferencesTags: string[] } -const currentTradeMockData = [ - { name: 'energyToBuy', label: 'Energy Sold', value: '210 (KWh)', disabled: true }, - { name: 'priceFixed', label: 'Price', value: '08 ₹/units', disabled: true } -] - const TradeDetails = () => { const bearerToken = Cookies.get('authToken') const strapiUrl = process.env.NEXT_PUBLIC_STRAPI_URL @@ -58,7 +53,7 @@ const TradeDetails = () => { quantity: result.quantity, date: result.createdAt, status: result.status, - tradeId: '20', + tradeId: result.id, tradeEvents: result.trade_events, preferencesTags: ['Solar', 'Biomass', 'Wind Power'] }) diff --git a/packages/becknified-components/src/components/order-status-progress/order-status-progress.types.ts b/packages/becknified-components/src/components/order-status-progress/order-status-progress.types.ts index 36e929b9f..457a5c3e6 100644 --- a/packages/becknified-components/src/components/order-status-progress/order-status-progress.types.ts +++ b/packages/becknified-components/src/components/order-status-progress/order-status-progress.types.ts @@ -1,5 +1,5 @@ export interface OrderStatusProgressProps { - label: string + label: string | React.ReactNode statusTime: string className?: string noLine?: boolean diff --git a/packages/molecules/src/components/typography/typography.types.ts b/packages/molecules/src/components/typography/typography.types.ts index 0c0d99ca8..44dd1766b 100644 --- a/packages/molecules/src/components/typography/typography.types.ts +++ b/packages/molecules/src/components/typography/typography.types.ts @@ -12,7 +12,7 @@ export type TextVariant = | 'tagRegular' export interface TypographyProps { - text: string + text: string | React.ReactNode variant?: TextVariant color?: string fontFamily?: string