@@ -43,12 +43,27 @@ export default function GitHubModal({ onClose }: GitHubModalProps) {
4343 const router = useRouter ( ) ;
4444 const [ loading , setLoading ] = useState ( false ) ;
4545
46- const redirectToProfilePage = async ( ) => {
46+ const redirectToProfilePage = ( ) => {
4747 if ( ! profile ) return ;
4848 setLoading ( true ) ;
49- await router . push ( `/${ profile ?. login } ?ref=modal` ) ;
49+
50+ // Get current search params and preserve them
51+ const currentParams = new URLSearchParams ( window . location . search ) ;
52+ currentParams . set ( 'ref' , 'modal' ) ;
53+
54+ // Use window.location for instant navigation
55+ window . location . href = `/${ profile ?. login } ?${ currentParams . toString ( ) } ` ;
56+ } ;
5057
51- // no need to setLoading(false) because navigation will replace this page
58+ const redirectToProfilePageFromCard = ( ) => {
59+ if ( ! profile ) return ;
60+
61+ // Get current search params and preserve them
62+ const currentParams = new URLSearchParams ( window . location . search ) ;
63+ currentParams . set ( 'ref' , 'modelv2' ) ;
64+
65+ // Use window.location for instant navigation
66+ window . location . href = `/${ profile ?. login } ?${ currentParams . toString ( ) } ` ;
5267 } ;
5368 // Debounce the username input to prevent excessive API calls
5469 const debouncedUsername = useDebounce ( username , 500 ) ;
@@ -152,7 +167,8 @@ export default function GitHubModal({ onClose }: GitHubModalProps) {
152167 < motion . div
153168 initial = { { opacity : 0 , y : 10 } }
154169 animate = { { opacity : 1 , y : 0 } }
155- className = "bg-gray-50 rounded-lg p-4 flex items-center gap-4"
170+ onClick = { redirectToProfilePageFromCard }
171+ className = "bg-gray-50 rounded-lg p-4 flex items-center gap-4 cursor-pointer hover:bg-gray-100 transition-colors"
156172 >
157173 < Image
158174 src = { profile . avatar_url }
0 commit comments