Skip to content

Commit

Permalink
BI-9: Make a simple search bar (#3)
Browse files Browse the repository at this point in the history
* search-bar feature added

* suggested changes added

* 2nd review

* merge commit fix

* prettier formate

* changes in stories

* export removed

* suggested changes made
  • Loading branch information
meenalnimje authored Oct 11, 2023
1 parent d2fbd21 commit e8176f6
Show file tree
Hide file tree
Showing 10 changed files with 5,531 additions and 75 deletions.
5,357 changes: 5,357 additions & 0 deletions data/university_data.json

Large diffs are not rendered by default.

143 changes: 79 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"dependencies": {
"autoprefixer": "10.4.16",
"next": "13.5.2",
"path": "^0.12.7",
"postcss": "8.4.30",
"promises": "^0.2.5",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3"
Expand Down
19 changes: 19 additions & 0 deletions src/app/college/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// The "use client" is used to declare a boundary between a Server and Client Component modules.
// This means that by defining a "use client" in a file, all other modules imported into it, including child components, are considered part of the client bundle - and will be rendered by React on the client.
// In this file useSearchParams is a client component.
'use client'

import jsonData from '../../../data/university_data'
import { useSearchParams } from 'next/navigation'

export default function Home() {
const router = useSearchParams()
const collegeList = jsonData
const id = router.get('id')
const selectedCollege = collegeList.find((item) => item.id === id)
return (
<main className="flex min-h-screen flex-col items-center justify-center p-24">
<h1 className="text-5xl font-bold z-10">{selectedCollege?.name}</h1>
</main>
)
}
Empty file.
Loading

0 comments on commit e8176f6

Please sign in to comment.