diff --git a/dapp/package-lock.json b/dapp/package-lock.json index 1974134..9065970 100644 --- a/dapp/package-lock.json +++ b/dapp/package-lock.json @@ -827,35 +827,6 @@ "node": ">= 10" } }, - "node_modules/@noble/curves": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.7.0.tgz", - "integrity": "sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@noble/hashes": "1.6.0" - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves/node_modules/@noble/hashes": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz", - "integrity": "sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@noble/hashes": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", @@ -941,16 +912,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@scure/base": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz", - "integrity": "sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==", - "license": "MIT", - "peer": true, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@scure/bip32": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", @@ -1011,33 +972,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@scure/starknet": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@scure/starknet/-/starknet-1.1.0.tgz", - "integrity": "sha512-83g3M6Ix2qRsPN4wqLDqiRZ2GBNbjVWfboJE/9UjfG+MHr6oDSu/CWgy8hsBSJejr09DkkL+l0Ze4KVrlCIdtQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@noble/curves": "~1.7.0", - "@noble/hashes": "~1.6.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/starknet/node_modules/@noble/hashes": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz", - "integrity": "sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==", - "license": "MIT", - "peer": true, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@starknet-io/types-js": { "version": "0.7.10", "resolved": "https://registry.npmjs.org/@starknet-io/types-js/-/types-js-0.7.10.tgz", @@ -3080,17 +3014,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fetch-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-3.0.1.tgz", - "integrity": "sha512-ZGXe8Y5Z/1FWqQ9q/CrJhkUD73DyBU9VF0hBQmEO/wPHe4A9PKTjplFDLeFX8aOsYypZUcX5Ji/eByn3VCVO3Q==", - "license": "Unlicense", - "peer": true, - "dependencies": { - "set-cookie-parser": "^2.4.8", - "tough-cookie": "^4.0.0" - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -3306,17 +3229,6 @@ "node": ">= 0.4" } }, - "node_modules/get-starknet-core": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/get-starknet-core/-/get-starknet-core-4.0.0.tgz", - "integrity": "sha512-6pLmidQZkC3wZsrHY99grQHoGpuuXqkbSP65F8ov1/JsEI8DDLkhsAuLCKFzNOK56cJp+f1bWWfTJ57e9r5eqQ==", - "deprecated": "Package no longer supported. Please use @starknet-io/get-starknet-core", - "license": "MIT", - "peer": true, - "dependencies": { - "@starknet-io/types-js": "^0.7.7" - } - }, "node_modules/get-symbol-description": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", @@ -4041,17 +3953,6 @@ "dev": true, "license": "ISC" }, - "node_modules/isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "license": "MIT", - "peer": true, - "dependencies": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, "node_modules/isows": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", @@ -4293,13 +4194,6 @@ "loose-envify": "cli.js" } }, - "node_modules/lossless-json": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-4.0.2.tgz", - "integrity": "sha512-+z0EaLi2UcWi8MZRxA5iTb6m4Ys4E80uftGY+yG5KNFJb5EceQXOhdW/pWJZ8m97s26u7yZZAYMcKWNztSZssA==", - "license": "MIT", - "peer": true - }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -4509,27 +4403,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", - "peer": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4791,13 +4664,6 @@ "dev": true, "license": "BlueOak-1.0.0" }, - "node_modules/pako": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", - "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", - "license": "(MIT AND Zlib)", - "peer": true - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5076,35 +4942,16 @@ "react-is": "^16.13.1" } }, - "node_modules/psl": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", - "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", - "license": "MIT", - "peer": true, - "dependencies": { - "punycode": "^2.3.1" - }, - "funding": { - "url": "https://github.com/sponsors/lupomontero" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "license": "MIT", - "peer": true - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -5248,13 +5095,6 @@ "node": ">=0.10.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "license": "MIT", - "peer": true - }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -5405,13 +5245,6 @@ "node": ">=10" } }, - "node_modules/set-cookie-parser": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", - "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", - "license": "MIT", - "peer": true - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -5639,47 +5472,6 @@ "dev": true, "license": "MIT" }, - "node_modules/starknet": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/starknet/-/starknet-6.24.1.tgz", - "integrity": "sha512-g7tiCt73berhcNi41otlN3T3kxZnIvZhMi8WdC21Y6GC6zoQgbI2z1t7JAZF9c4xZiomlanwVnurcpyfEdyMpg==", - "license": "MIT", - "peer": true, - "dependencies": { - "@noble/curves": "1.7.0", - "@noble/hashes": "1.6.0", - "@scure/base": "1.2.1", - "@scure/starknet": "1.1.0", - "abi-wan-kanabi": "^2.2.3", - "fetch-cookie": "~3.0.0", - "isomorphic-fetch": "~3.0.0", - "lossless-json": "^4.0.1", - "pako": "^2.0.4", - "starknet-types-07": "npm:@starknet-io/types-js@^0.7.10", - "ts-mixer": "^6.0.3" - } - }, - "node_modules/starknet-types-07": { - "name": "@starknet-io/types-js", - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/@starknet-io/types-js/-/types-js-0.7.10.tgz", - "integrity": "sha512-1VtCqX4AHWJlRRSYGSn+4X1mqolI1Tdq62IwzoU2vUuEE72S1OlEeGhpvd6XsdqXcfHmVzYfj8k1XtKBQqwo9w==", - "license": "MIT", - "peer": true - }, - "node_modules/starknet/node_modules/@noble/hashes": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz", - "integrity": "sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -6114,39 +5906,6 @@ "node": ">=8.0" } }, - "node_modules/tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT", - "peer": true - }, "node_modules/ts-api-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", @@ -6167,13 +5926,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/ts-mixer": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz", - "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==", - "license": "MIT", - "peer": true - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -6288,7 +6040,7 @@ "version": "5.7.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "devOptional": true, + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -6343,17 +6095,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -6406,31 +6147,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/whatwg-fetch": { - "version": "3.6.20", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", - "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", - "license": "MIT", - "peer": true - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "peer": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/dapp/public/images/CryptoPunk.svg b/dapp/public/images/CryptoPunk.svg new file mode 100644 index 0000000..bc5bbf5 --- /dev/null +++ b/dapp/public/images/CryptoPunk.svg @@ -0,0 +1,18 @@ + +
+ + + + + + + + + + + + + + + +
diff --git a/dapp/public/images/Icon.svg b/dapp/public/images/Icon.svg new file mode 100644 index 0000000..d87d299 --- /dev/null +++ b/dapp/public/images/Icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/dapp/public/images/back-icon.svg b/dapp/public/images/back-icon.svg new file mode 100644 index 0000000..24fc3c4 --- /dev/null +++ b/dapp/public/images/back-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/dapp/public/images/triangle.svg b/dapp/public/images/triangle.svg new file mode 100644 index 0000000..eaf3234 --- /dev/null +++ b/dapp/public/images/triangle.svg @@ -0,0 +1,3 @@ + + + diff --git a/dapp/public/images/undo.svg b/dapp/public/images/undo.svg new file mode 100644 index 0000000..69e60b8 --- /dev/null +++ b/dapp/public/images/undo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dapp/public/images/world.svg b/dapp/public/images/world.svg new file mode 100644 index 0000000..dd35b54 --- /dev/null +++ b/dapp/public/images/world.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dapp/src/app/escrow/page.tsx b/dapp/src/app/escrow/page.tsx index 1165b65..02df3be 100644 --- a/dapp/src/app/escrow/page.tsx +++ b/dapp/src/app/escrow/page.tsx @@ -1,11 +1,14 @@ +import { Suspense } from "react"; import LoanHistory from "./components/loanhistory"; import NFTInformation from "./components/nftinformation"; import OwnerInfo from "./components/ownerinfo"; const Page = () => { - return ( + return (
- + + +
@@ -14,8 +17,8 @@ const Page = () => {
-
+ ); } - + export default Page; \ No newline at end of file diff --git a/dapp/src/app/layout.tsx b/dapp/src/app/layout.tsx index 0011196..516b780 100644 --- a/dapp/src/app/layout.tsx +++ b/dapp/src/app/layout.tsx @@ -1,5 +1,5 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; +import { Geist, Geist_Mono, Oxanium } from "next/font/google"; import "./globals.css"; import Navbar from "../app/components/navbar"; import Sidebar from "../app/components/sidebar"; @@ -14,6 +14,13 @@ const geistMono = Geist_Mono({ subsets: ["latin"], }); + +const oxanium = Oxanium({ + variable: "--font-oxanium", + subsets: ["latin"], + display: "swap", +}) + export const metadata: Metadata = { title: "Trajectifi", description: "Trajectifi DApp", @@ -27,7 +34,7 @@ export default function RootLayout({ return (
diff --git a/dapp/src/app/view-listed-asset/component/AcceptOfferComponent.tsx b/dapp/src/app/view-listed-asset/component/AcceptOfferComponent.tsx new file mode 100644 index 0000000..d6edbf0 --- /dev/null +++ b/dapp/src/app/view-listed-asset/component/AcceptOfferComponent.tsx @@ -0,0 +1,215 @@ +"use client" + + +import { tableDataProps } from "@/utils/interface"; +import { X } from "lucide-react"; +import Image from "next/image"; +import React, { SetStateAction, useState } from "react"; + + + + + + +interface AcceptOfferComponentProps { + setOpenModal: React.Dispatch>; + selectedNFT: tableDataProps | null; + setSelectedNFT: React.Dispatch> +} + +export default function AcceptOfferComponent({ setOpenModal, selectedNFT, setSelectedNFT }: AcceptOfferComponentProps) { + const [currentStep, setCurrentStep] = useState(1); + const [agreed, setAgreed] = useState(false) + + + + + const optionButtons = [ + { + imageSrc: "/images/world.svg", + path: "#" + }, + { + imageSrc: "/images/triangle.svg", + path: "#" + }, + { + imageSrc: "/images/undo.svg", + path: "#" + }, + ] + + + + const offerSummary = [ + { + title: "Lender", + value: selectedNFT?.lender, + }, + { + title: "Currency", + value: "STRK", + }, + { + title: "Acceptable Amount", + value: selectedNFT?.loanValue.toLocaleString("en-us") + " " + "STRK", + }, + { + title: "Loan Duration", + value: selectedNFT?.duration , + }, + { + title: "APR", + value: selectedNFT?.apr + "%", + }, + { + title: "Repayment", + value: selectedNFT?.repayment.toLocaleString("en-us"), + }, + ] + + + const handleCheck = (e: React.ChangeEvent) => { + setAgreed(e.target.checked); + }; + + + const closeModal = () => { + setOpenModal(false) + setSelectedNFT(null) + } + + + + return ( +
+ + +
+ + + + + {/* step 1 */} + <> +
{ + e.stopPropagation() + } } + className={`w-full flex-col md:flex-row max-w-[900px] py-3 px-6 bg-[#121428] h-full md:max-h-[512px] flex items-stretch justify-between rounded-2xl gap-6 absolute top-[50%] left-[50%] translate-y-[-50%] transform transition-all duration-200 ${currentStep === 1 ? "translate-x-[-50%] " : "translate-x-[-500%] "} `} > +
+
+ +
+

Cryptopunk #1232

+

Cryptopunk VQ (Wrapped ETH)

+
+ + + + + Listed + +
+
+ + + +
+ +
+

Accept Offer

+ +
+ + +
    + + {offerSummary.map((item, index) => ( +
  • {item.title} {item.value}
  • + ))} + +
+ + + + + + +
+ {optionButtons.map((button, index) => ( + + ))} +
+ + + + + +
+
+ + + + + {/* step 2 */} + <> +
{ + e.stopPropagation() + } } + className={` w-full max-w-[400px] h-full max-h-[512px] bg-[#121428] border-[1px] border-[#1C1F3F] py-5 px-3 rounded-2xl flex items-center flex-col gap-6 absolute top-[50%] left-[50%] translate-y-[-50%] transform transition-all duration-200 ${currentStep < 2 ? "translate-x-[500%] " : "translate-x-[-50%]"} `} > +
+

Accept Offer

+ +
+ + +
+
Sign Transaction
+

Please click 'Sign' to open your wallet, confirm the transaction, and begin the loan.

+
+ + + +

By Signing this transaction you Agree to our Terms of Service and Terms of Use.

+ + + +
+ + + + +
+ + +
+ + + +
+
+ ) +} \ No newline at end of file diff --git a/dapp/src/app/view-listed-asset/component/FilterBar.tsx b/dapp/src/app/view-listed-asset/component/FilterBar.tsx index edea660..9819d5b 100644 --- a/dapp/src/app/view-listed-asset/component/FilterBar.tsx +++ b/dapp/src/app/view-listed-asset/component/FilterBar.tsx @@ -1,15 +1,17 @@ +import { LayoutGrid, List } from "lucide-react"; + export default function FilterBar() { return (
-

filter:

+

Filter:

- - - + + +
- - + +
); diff --git a/dapp/src/app/view-listed-asset/component/ListingInfo.tsx b/dapp/src/app/view-listed-asset/component/ListingInfo.tsx index 105fda1..2c8b133 100644 --- a/dapp/src/app/view-listed-asset/component/ListingInfo.tsx +++ b/dapp/src/app/view-listed-asset/component/ListingInfo.tsx @@ -1,34 +1,59 @@ import Image from "next/image"; -import Punk from "@/assets/punk.png"; -import Net from "@/assets/net.png"; -import Reload from "@/assets/reload.png"; -import Angle from "@/assets/angle.png"; + export default function ListingInfo() { + + + const optionButtons = [ + { + imageSrc: "/images/world.svg", + path: "#" + }, + { + imageSrc: "/images/triangle.svg", + path: "#" + }, + { + imageSrc: "/images/undo.svg", + path: "#" + }, + ] + + + + + return ( -
+
-

Listing Information

+

Listing Information

- network - angle - reload + + {optionButtons.map((button, index) => ( + + )) + + } +
-
+
CryptoPunk

Cryptopunk #1232

Cryptopunk VQ (STRK)

- + Listed
@@ -57,7 +82,7 @@ export default function ListingInfo() { You can unlist your item at any time.

-
+
diff --git a/dapp/src/app/view-listed-asset/component/LoanRow.tsx b/dapp/src/app/view-listed-asset/component/LoanRow.tsx index 9eb829b..36fd4a6 100644 --- a/dapp/src/app/view-listed-asset/component/LoanRow.tsx +++ b/dapp/src/app/view-listed-asset/component/LoanRow.tsx @@ -1,14 +1,37 @@ -export default function LoanRow() { +import { tableDataProps } from "@/utils/interface"; +import React from "react"; + + +interface LoanRowProps { + setOpenModal: React.Dispatch> + tableData: tableDataProps + setSelectedNFT: React.Dispatch> + +} + + + +export default function LoanRow({setOpenModal, tableData, setSelectedNFT}: LoanRowProps) { + + + + const handleClick = (tableData: tableDataProps) => { + setOpenModal(true) + setSelectedNFT(tableData) + } + + + return ( - - 2,856.41 - 0D673a4...2 - 1.17% - 14.19% - 30 days - 2,891.75 - - diff --git a/dapp/src/app/view-listed-asset/component/LoanTable.tsx b/dapp/src/app/view-listed-asset/component/LoanTable.tsx index 045a31d..f9c5ece 100644 --- a/dapp/src/app/view-listed-asset/component/LoanTable.tsx +++ b/dapp/src/app/view-listed-asset/component/LoanTable.tsx @@ -1,31 +1,110 @@ +import React, { useState } from 'react'; import FilterBar from './FilterBar'; import LoanRow from './LoanRow'; +import { tableData } from '../data'; +import { ChevronLeft, ChevronRight } from 'lucide-react'; +import { tableDataProps } from '@/utils/interface'; + +interface LoanTableProps { + setOpenModal: React.Dispatch>; + setSelectedNFT: React.Dispatch> + +} + +export default function LoanTable({ setOpenModal, setSelectedNFT }: LoanTableProps) { + const [currentPage, setCurrentPage] = useState(1); + const itemsPerPage = 6; + + const totalPages = Math.ceil(tableData.length / itemsPerPage); + + const startIndex = (currentPage - 1) * itemsPerPage; + const endIndex = currentPage * itemsPerPage; + + const handlePrev = () => { + if (currentPage > 1) { + setCurrentPage((prev) => prev - 1); + } + }; + + const handleNext = () => { + if (currentPage < totalPages) { + setCurrentPage((prev) => prev + 1); + } + }; + + const pages = Array.from({ length: totalPages }, (_, i) => i + 1); + + + -export default function LoanTable() { return ( -
+
+
- - - - - - - - + + + + + + + + - {[...Array(6)].map((_, i) => ( - + {tableData.slice(startIndex, endIndex).map((loanDetails, i) => ( + ))}
Loan valueLenderInterestAPRDurationRepaymentAction
Loan valueLenderInterestAPRDurationRepaymentAction
-
- Showing 1 to 6 of 13 items + +
+

+ Showing {startIndex + 1} to{' '} + {endIndex > tableData.length ? tableData.length : endIndex} of{' '} + {tableData.length} items +

+ +
+ + +
    + {pages.map((page) => ( +
  • setCurrentPage(page)} + className={`px-2.5 py-1.5 rounded cursor-pointer text-sm ${currentPage === page + ? 'bg-[#DEDEDE] text-black' + : 'text-[#707070] ' + }`} + > + {page} +
  • + ))} +
+ + +
diff --git a/dapp/src/app/view-listed-asset/data.ts b/dapp/src/app/view-listed-asset/data.ts new file mode 100644 index 0000000..c902cc0 --- /dev/null +++ b/dapp/src/app/view-listed-asset/data.ts @@ -0,0 +1,164 @@ +import { tableDataProps } from "@/utils/interface"; + +export const tableData: tableDataProps[] = [ + { + loanValue: 2856.41, + lender: "09b73a42", + interest: 1.17, + apr: 14.18, + duration: "30 days", + repayment: 2891.75 + }, + { + loanValue: 3200.00, + lender: "a8e13c29", + interest: 1.25, + apr: 15.00, + duration: "60 days", + repayment: 3280.00 + }, + { + loanValue: 1500.50, + lender: "1f63ac84", + interest: 0.95, + apr: 11.40, + duration: "15 days", + repayment: 1514.75 + }, + { + loanValue: 4000.00, + lender: "72ce49a1", + interest: 2.00, + apr: 18.25, + duration: "90 days", + repayment: 4080.00 + }, + { + loanValue: 2100.75, + lender: "5a3f902c", + interest: 1.10, + apr: 13.20, + duration: "45 days", + repayment: 2123.86 + }, + { + loanValue: 500.00, + lender: "d21b3a97", + interest: 0.50, + apr: 10.00, + duration: "7 days", + repayment: 502.50 + }, + { + loanValue: 10000.00, + lender: "34df2c10", + interest: 3.00, + apr: 20.00, + duration: "120 days", + repayment: 10300.00 + }, + { + loanValue: 6750.40, + lender: "6f48213b", + interest: 1.75, + apr: 16.00, + duration: "60 days", + repayment: 6868.51 + }, + { + loanValue: 950.90, + lender: "b89103d2", + interest: 0.80, + apr: 12.50, + duration: "20 days", + repayment: 958.50 + }, + { + loanValue: 3800.00, + lender: "29cf3b76", + interest: 1.50, + apr: 15.75, + duration: "75 days", + repayment: 3857.00 + }, + { + loanValue: 2750.25, + lender: "aa23cd34", + interest: 1.40, + apr: 13.85, + duration: "30 days", + repayment: 2788.76 + }, + { + loanValue: 1800.00, + lender: "cf14ba88", + interest: 1.20, + apr: 14.50, + duration: "25 days", + repayment: 1821.60 + }, + { + loanValue: 7400.00, + lender: "de009344", + interest: 2.25, + apr: 19.00, + duration: "90 days", + repayment: 7566.50 + }, + { + loanValue: 600.00, + lender: "f3b7e2a9", + interest: 0.60, + apr: 9.50, + duration: "10 days", + repayment: 603.60 + }, + { + loanValue: 8300.80, + lender: "81c42a33", + interest: 2.10, + apr: 17.85, + duration: "100 days", + repayment: 8475.11 + }, + { + loanValue: 250.00, + lender: "112fe674", + interest: 0.25, + apr: 8.00, + duration: "5 days", + repayment: 250.63 + }, + { + loanValue: 1225.60, + lender: "e7a9fbd0", + interest: 0.85, + apr: 11.00, + duration: "14 days", + repayment: 1236.01 + }, + { + loanValue: 4700.00, + lender: "90dbba21", + interest: 1.65, + apr: 14.70, + duration: "50 days", + repayment: 4777.55 + }, + { + loanValue: 3500.00, + lender: "7c4e5a20", + interest: 1.30, + apr: 13.90, + duration: "40 days", + repayment: 3545.50 + }, + { + loanValue: 2980.00, + lender: "a21fbc09", + interest: 1.15, + apr: 13.50, + duration: "35 days", + repayment: 3014.27 + } +]; diff --git a/dapp/src/app/view-listed-asset/page.tsx b/dapp/src/app/view-listed-asset/page.tsx index 0a40202..673618a 100644 --- a/dapp/src/app/view-listed-asset/page.tsx +++ b/dapp/src/app/view-listed-asset/page.tsx @@ -1,21 +1,46 @@ -import React from 'react'; +"use client" + + + +import React, { useEffect, useState } from 'react'; import ListingInfo from './component/ListingInfo'; import LoanTable from './component/LoanTable'; +import Image from 'next/image'; +import AcceptOfferComponent from './component/AcceptOfferComponent'; +import { useRouter } from 'next/navigation'; +import { tableDataProps } from '@/utils/interface'; + const Page = () => { +const [openModal, setOpenModal] = useState(false) +const router = useRouter() +const [selectedNFT, setSelectedNFT] = useState(null) + + +useEffect(() => { + + document.body.style.overflowY = openModal ? "hidden" : "auto" + + +}, [openModal]) + + + + return ( -
-
-
- +
+
+ {openModal && }
); }; diff --git a/dapp/src/utils/interface.ts b/dapp/src/utils/interface.ts new file mode 100644 index 0000000..47a2647 --- /dev/null +++ b/dapp/src/utils/interface.ts @@ -0,0 +1,11 @@ + + + +export interface tableDataProps { +loanValue: number; +lender: string; +interest: number; +apr: number; +duration: string; +repayment: number; +} \ No newline at end of file diff --git a/dapp/tailwind.config.ts b/dapp/tailwind.config.ts index 95de64d..570af2d 100644 --- a/dapp/tailwind.config.ts +++ b/dapp/tailwind.config.ts @@ -23,6 +23,9 @@ export default { backgroundImage: { 'page-bg': "url('/images/bg-image.png')", }, + fontFamily: { + oxanium: ["var(--font-oxanium)"] + } }, }, plugins: [],