Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BI-9: Make a simple search bar #3

Merged
merged 9 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just leaving this comment over here, but it is unrelated to this code. There are some minor reasons due to which the build failed. We'll require a passing build to merge this code to the main branch.

"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
Loading