File tree Expand file tree Collapse file tree 6 files changed +73
-71
lines changed
src/app/(public)/_components Expand file tree Collapse file tree 6 files changed +73
-71
lines changed Original file line number Diff line number Diff line change 11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
3+ /// <reference path="./.next/types/routes.d.ts" />
34
45// NOTE: This file should not be edited
56// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const __dirname = path.dirname(__filename);
88/**@type {import('next').NextConfig }*/
99const config = {
1010 reactStrictMode : true ,
11+ typedRoutes : true ,
1112 experimental : {
1213 viewTransition : true
1314 } ,
Original file line number Diff line number Diff line change 2929 "dotenv-cli" : " ^10.0.0" ,
3030 "drizzle-orm" : " ^0.44.6" ,
3131 "eslint" : " ^9.32.0" ,
32- "eslint-config-next" : " ^15.4.5 " ,
32+ "eslint-config-next" : " ^15.5.4 " ,
3333 "framer-motion" : " ^12.23.12" ,
3434 "jotai" : " ^2.12.5" ,
3535 "lucide-react" : " ^0.536.0" ,
36- "next" : " ^15.4.5 " ,
36+ "next" : " ^15.5.4 " ,
3737 "next-auth" : " 5.0.0-beta.29" ,
3838 "next-cloudinary" : " ^6.16.0" ,
3939 "next-seo" : " ^6.8.0" ,
Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ export function Hero() {
3232 function handleSearch ( e : React . FormEvent ) {
3333 e . preventDefault ( ) ;
3434 const formData = new FormData ( e . target as HTMLFormElement ) ;
35- let chosenLanguages = selected ;
35+ const chosenLanguages = [ ... selected ] ;
3636
3737 // Fallback: if no checkbox selected, use the single input value
3838 if ( chosenLanguages . length === 0 ) {
3939 const typed = String ( formData . get ( 'search' ) || '' ) . trim ( ) ;
4040 if ( typed ) {
41- chosenLanguages = [ typed ] ;
41+ chosenLanguages . push ( typed ) ;
4242 }
4343 }
4444
Original file line number Diff line number Diff line change @@ -26,20 +26,20 @@ export function SearchForm() {
2626 }
2727
2828 function onSubmit ( { searchQuery } : FormValues ) {
29+ if ( ! pathname . startsWith ( '/repos' ) ) return ;
30+
31+ const reposPathname = pathname as `/repos/${string } `;
2932 const trimmedQuery = searchQuery . trim ( ) ;
3033 if ( trimmedQuery !== '' ) {
3134 const sp = new URLSearchParams ( searchParams ) ;
3235 sp . set ( 'q' , trimmedQuery ) ;
33- router . push ( `${ pathname } ?${ sp . toString ( ) } ` ) ;
36+ router . push ( `${ reposPathname } ?${ sp . toString ( ) } ` ) ;
3437 }
3538 }
3639
3740 return (
3841 < div className = "w-full" >
39- < form
40- className = "w-full form-control"
41- onSubmit = { handleSubmit ( onSubmit ) }
42- >
42+ < form className = "w-full form-control" onSubmit = { handleSubmit ( onSubmit ) } >
4343 < div className = "relative" >
4444 < input
4545 placeholder = "Search"
You can’t perform that action at this time.
0 commit comments