From 6b596451c50246681fe076c1a8ac4a3fce76fac6 Mon Sep 17 00:00:00 2001 From: Adnan Hashmi <56730784+adnanhashmi09@users.noreply.github.com> Date: Sun, 23 Oct 2022 00:11:04 +0530 Subject: [PATCH] Revert "feature: history component for warranty transactions (#6)" (#9) * Revert "feature: history component for warranty transactions (#6)" This reverts commit 8a5e5bf445d48b44258008a7fe265e41b9ff814e. * Update styles/components/warrantyPage.module.scss Co-authored-by: DecFox <33030671+DecFox@users.noreply.github.com> Co-authored-by: DecFox <33030671+DecFox@users.noreply.github.com> --- components/tables/Table.tsx | 46 ---------------------- pages/mocks/MockWarranty.json | 36 ----------------- pages/warranty/[slug].tsx | 20 ---------- styles/components/TableGeneric.module.scss | 39 ------------------ styles/components/warrantyPage.module.scss | 11 +----- 5 files changed, 1 insertion(+), 151 deletions(-) delete mode 100644 components/tables/Table.tsx delete mode 100644 pages/mocks/MockWarranty.json delete mode 100644 styles/components/TableGeneric.module.scss diff --git a/components/tables/Table.tsx b/components/tables/Table.tsx deleted file mode 100644 index 7fb4759..0000000 --- a/components/tables/Table.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import styles from '../../styles/components/TableGeneric.module.scss'; - -// constants and variables -interface Header { - txn: string; - event?: string; - to?: string; - from?: string; - date?: string -} - -function Table({headers, data} : {headers: Header, data: any}) { - return ( - - - - {Object.values(headers).map((header: string) => { - return ( - - ); - })} - - {data.map((entry: any, id: number) => { - return ( - - {Object.keys(headers).map((header: string) => - Object.entries(entry).map(([key, val]: [key: string, val: any]) => { - if(key == header) { - return ( - - ) - } - } - ) - )} - - ); - })} - -
{header}
- {key === 'txn' ? {val} : val} -
- ); -} - -export default Table; \ No newline at end of file diff --git a/pages/mocks/MockWarranty.json b/pages/mocks/MockWarranty.json deleted file mode 100644 index 3a7bce2..0000000 --- a/pages/mocks/MockWarranty.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "CryptoApe #1777", - "minter": "CryptoApe Co.", - "description": "Imperdiet at in interdum mattis. Cursus faucibus pellentesque vitae risus sit commodo vitae. Imperdiet at in interdum mattis. Cursus faucibus pellentesque vitae risus sit commodo vitae.", - "txnAddress": "0x4040d1dd5B6f9C864d9db560D72a247c178aE86B", - "owner": "Null_Crack", - "ownerAddress": "0x29D7d1dd5B6f9C864d9db560D72a247c178aE86B", - "bid": 0.54, - "bidAddress": "0x34D7d1dd5B689C864d9db560D72a247c178aE86B", - "history": [ - { - "event": "Sale", - "to": "Recipient", - "from": "Owner", - "price": 0.43, - "date": "01.01.2001", - "txn": "0x1472d1dd5B6f9C864d9db560D72a247c178aE86B" - }, - { - "event": "Transfer", - "to": "Recipient", - "from": "Owner", - "price": null, - "date": "01.01.2001", - "txn": "0x8900d1dd5B6f9C864d9db560D72a247c178aE86B" - }, - { - "event": "Minted", - "to": "Minter", - "from": "Minter", - "price": null, - "date": "01.01.2001", - "txn": "0x5230d1dd5B6f9C864d9db560D72a247c178aE86B" - } - ] -} \ No newline at end of file diff --git a/pages/warranty/[slug].tsx b/pages/warranty/[slug].tsx index 1ad9211..229678a 100644 --- a/pages/warranty/[slug].tsx +++ b/pages/warranty/[slug].tsx @@ -7,32 +7,15 @@ import styles from '../../styles/components/warrantyPage.module.scss'; import Meta from '../../components/utils/Meta'; import Image from 'next/image'; import Button from '../../components/reusables/Button'; -import Table from '../../components/tables/Table'; -import { useState } from 'react'; - -// mock data -import MockWarranty from '../mocks/MockWarranty.json'; // variables / constants -const mockWarranty = MockWarranty - -const warrantyHistory = { - "event": "Event", - "to": "To", - "from": "From", - "date": "Date", - "txn": "Transaction" -} - const meta = { title: 'Warranty Card', description: 'Warranty Card for your product.', }; const WarrantyCard: NextPage = () => { - const [warranty, setWarranty] = useState(mockWarranty) - return ( <> @@ -79,9 +62,6 @@ const WarrantyCard: NextPage = () => { -
- - ); diff --git a/styles/components/TableGeneric.module.scss b/styles/components/TableGeneric.module.scss deleted file mode 100644 index f44b012..0000000 --- a/styles/components/TableGeneric.module.scss +++ /dev/null @@ -1,39 +0,0 @@ -@use '../utils/variables' as *; -@use '../utils/include-media' as *; - -.table { - width: 85%; - font-size: 1.5rem; - border-collapse: collapse; - overflow-x: auto; - display: block; - - &__row { - &__header { - border-top: 1px solid $clr-white; - } - - &__content { - border-bottom: 1px solid $clr-white; - } - } - - &__header { - background-color: #2b2b2b; - font-weight: 500; - padding: 15px 3rem; - text-align: center; - } - - &__content { - font-weight: 400; - padding: 20px 3rem; - text-align: center; - - a { - :hover { - cursor: pointer; - } - } - } -} \ No newline at end of file diff --git a/styles/components/warrantyPage.module.scss b/styles/components/warrantyPage.module.scss index 0ede50e..943892d 100644 --- a/styles/components/warrantyPage.module.scss +++ b/styles/components/warrantyPage.module.scss @@ -118,15 +118,6 @@ } } } - - &__table { - width: 100vw; - display: flex; - justify-content: center; - margin: 3rem 0 5rem 0; - @include media('>=mindesk') { - width: 100%; - } - } + // sample review comment } }