diff --git a/packages/examples/dnode-dapp/package-lock.json b/packages/examples/dnode-dapp/package-lock.json index 1ad0b56ff..006de4114 100644 --- a/packages/examples/dnode-dapp/package-lock.json +++ b/packages/examples/dnode-dapp/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@headlessui/react": "^2.1.1", "@heroicons/react": "^2.1.4", - "@pushprotocol/dnode": "^0.0.2", + "@pushprotocol/dnode": "^0.0.3", "@rainbow-me/rainbowkit": "^2.1.3", "@tailwindcss/forms": "^0.5.7", "@tanstack/react-query": "^5.28.4", @@ -3719,9 +3719,9 @@ } }, "node_modules/@pushprotocol/dnode": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@pushprotocol/dnode/-/dnode-0.0.2.tgz", - "integrity": "sha512-ok+W/RBobXCT1giFkpowwW8Jt2w8x2RWx4f0t5Xw6BbMB545ria/+jPagH5DG7SZN7vAn/VbCo2PkrKecesfIQ==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@pushprotocol/dnode/-/dnode-0.0.3.tgz", + "integrity": "sha512-rsE1Czeb/+3lmlPIAlTw/bcM7gxZfWHcRuJQQao4YU6FbzZwD1bXY0bukgt08V73Pvp40heFCnHC7UUeaWmozg==", "dependencies": { "@metamask/eth-sig-util": "^5.0.2", "buffer": "^6.0.3", diff --git a/packages/examples/dnode-dapp/package.json b/packages/examples/dnode-dapp/package.json index 39f9fec23..f96927e72 100644 --- a/packages/examples/dnode-dapp/package.json +++ b/packages/examples/dnode-dapp/package.json @@ -10,7 +10,7 @@ "dependencies": { "@headlessui/react": "^2.1.1", "@heroicons/react": "^2.1.4", - "@pushprotocol/dnode": "^0.0.2", + "@pushprotocol/dnode": "^0.0.3", "@rainbow-me/rainbowkit": "^2.1.3", "@tailwindcss/forms": "^0.5.7", "@tanstack/react-query": "^5.28.4", diff --git a/packages/examples/dnode-dapp/public/user.png b/packages/examples/dnode-dapp/public/user.png new file mode 100644 index 000000000..ee78302d0 Binary files /dev/null and b/packages/examples/dnode-dapp/public/user.png differ diff --git a/packages/examples/dnode-dapp/src/components/SearchBar.tsx b/packages/examples/dnode-dapp/src/components/SearchBar.tsx index 8f8ab9520..936a1530d 100644 --- a/packages/examples/dnode-dapp/src/components/SearchBar.tsx +++ b/packages/examples/dnode-dapp/src/components/SearchBar.tsx @@ -1,18 +1,15 @@ -// components/SearchBar.tsx - import React, { useState } from 'react'; -import { MagnifyingGlassIcon } from '@heroicons/react/24/outline'; // Import MagnifyingGlassIcon from Heroicons v2 - -interface SearchBarProps { - onSearch: (searchTerm: string) => void; // Callback function to handle search -} +import { MagnifyingGlassIcon } from '@heroicons/react/24/outline'; +import { useRouter } from 'next/router'; -const SearchBar: React.FC = ({ onSearch }) => { +const SearchBar: React.FC = () => { const [searchTerm, setSearchTerm] = useState(''); + const router = useRouter(); const handleSearch = () => { if (searchTerm.trim()) { - onSearch(searchTerm); + // Navigate to the search results page + router.push(`/pushscan/${encodeURIComponent(searchTerm.trim())}`); } }; @@ -24,15 +21,13 @@ const SearchBar: React.FC = ({ onSearch }) => { return (
- {' '} - {/* max-w-lg to reduce width */} setSearchTerm(e.target.value)} - onKeyDown={handleKeyDown} // Use onKeyDown instead of onKeyPress + onKeyDown={handleKeyDown} /> + )} + {page * size < total && ( + + )} +
); }