Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
wilhelmrauston committed Feb 28, 2024
1 parent d933ee8 commit 5378ca4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Global/NavbarGlobal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export function NavbarGlobal({ searchBar = true, navClassName }) {
<SearchBar />
</div>
)}
<QrCodeIcon className='h-14 cursor-pointer p-2 text-gray-800 transition duration-200 ease-in-out hover:text-teal-600' />

<Link href='/scan' className='flex h-full items-center'>
<QrCodeIcon className='h-14 cursor-pointer p-2 text-gray-800 transition duration-200 ease-in-out hover:text-teal-600' />
</Link>
{/* Right Section for Navigation Links */}

<Example />
Expand Down
9 changes: 9 additions & 0 deletions src/components/Global/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import clsx from 'clsx'
import SearchField from '../UI/Forms/SearchField'
import SearchResultCard from '../UI/global/SearchResultCard'
import Link from 'next/link'
import { useRouter } from 'next/router'

export default function SearchBar({ className, ...props }) {
const router = useRouter()
const [searchTerm, setSearchTerm] = useState('')
const [searchResult, setSearchResult] = useState([])
const [loading, setLoading] = useState(false)
Expand Down Expand Up @@ -56,6 +58,11 @@ export default function SearchBar({ className, ...props }) {
setShowSearchResults(false)
}

const handleSearchSelect = url => {
router.push(url)
handleBlur()
}

return (
<div className={clsx('relative', className)}>
<div className='relative w-full'>
Expand Down Expand Up @@ -89,6 +96,8 @@ export default function SearchBar({ className, ...props }) {
return (
<li
key={uniqueKey}
onClick={() => handleSearchSelect('/product/' + item._id)}
onMouseDown={e => e.preventDefault()}
className='flex flex-row items-center space-x-4 p-2 hover:bg-gray-100'
>
<SearchResultCard item={item} />
Expand Down
21 changes: 21 additions & 0 deletions src/pages/api/v1/CA/dpp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defaultHandler } from '@/utils/server/api-helpers'

const postScans = async (req, res, session) => {}

const getScans = async (req, res, session) => {}

const handler = async (req, res) =>
defaultHandler(
req,
res,
{
POST: createKeypair,
GET: getPrivByPub,
},
{
requiresAuth: true,
requiresAdmin: false,
}
)

export default handler

0 comments on commit 5378ca4

Please sign in to comment.