@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
2
2
import { Github , Heart } from 'lucide-react' ;
3
3
import SearchBar from './components/SearchBar' ;
4
4
import UserList from './components/UserList' ;
5
- import { GitHubUser , SearchResults } from './types/github' ;
5
+ import { GitHubUser } from './types/github' ;
6
6
import { ThemeProvider , useTheme } from './contexts/ThemeContext' ;
7
7
import { ThemeSwitcher } from './components/ThemeSwitcher' ;
8
8
import { Octokit } from '@octokit/rest' ;
@@ -19,10 +19,11 @@ function AppContent() {
19
19
const [ error , setError ] = useState < string | null > ( null ) ;
20
20
const [ loading , setLoading ] = useState ( false ) ;
21
21
22
- // Redirect user to home screen after signing in
22
+ // Redirect user to the home screen after logging in
23
23
useEffect ( ( ) => {
24
24
if ( isAuthenticated ) {
25
- window . history . replaceState ( { } , document . title , '/' ) ; // Remove code from URL
25
+ // Remove the OAuth code from the URL
26
+ window . history . replaceState ( { } , document . title , '/' ) ;
26
27
}
27
28
} , [ isAuthenticated ] ) ;
28
29
@@ -131,25 +132,23 @@ function AppContent() {
131
132
searchUsers ( page ) ;
132
133
} ;
133
134
134
- const renderAuthButton = ( ) => {
135
- return (
136
- < div className = "flex flex-col items-end gap-2" >
137
- { authError && < div className = "text-red-500 text-sm" > { authError } </ div > }
138
- { ! isAuthenticated && (
139
- < button
140
- onClick = { login }
141
- className = { `px-4 py-2 rounded-md ${
142
- theme === 'dark'
143
- ? 'bg-white text-black hover:bg-gray-200'
144
- : 'bg-black text-white hover:bg-gray-800'
145
- } `}
146
- >
147
- Sign in with GitHub
148
- </ button >
149
- ) }
150
- </ div >
151
- ) ;
152
- } ;
135
+ const renderAuthButton = ( ) => (
136
+ < div className = "flex flex-col items-end gap-2" >
137
+ { authError && < div className = "text-red-500 text-sm" > { authError } </ div > }
138
+ { ! isAuthenticated && (
139
+ < button
140
+ onClick = { login }
141
+ className = { `px-4 py-2 rounded-md ${
142
+ theme === 'dark'
143
+ ? 'bg-white text-black hover:bg-gray-200'
144
+ : 'bg-black text-white hover:bg-gray-800'
145
+ } `}
146
+ >
147
+ Sign in with GitHub
148
+ </ button >
149
+ ) }
150
+ </ div >
151
+ ) ;
153
152
154
153
return (
155
154
< div className = { `min-h-screen flex flex-col ${ theme === 'dark' ? 'bg-black' : 'bg-white' } ` } >
@@ -166,7 +165,7 @@ function AppContent() {
166
165
< h1
167
166
className = { `text-4xl font-bold ${ theme === 'dark' ? 'text-white' : 'text-black' } tracking-tight` }
168
167
>
169
- GitHub Bio Search
168
+ GitHub User Search
170
169
</ h1 >
171
170
</ div >
172
171
< p className = { `text-lg ${ theme === 'dark' ? 'text-gray-400' : 'text-gray-600' } ` } >
0 commit comments