File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,10 @@ import Blogs from "./components/Blogs";
14
14
import { trpc } from "../utils/trpc" ;
15
15
16
16
const secret : NextPage = ( ) => {
17
-
18
17
const [ isAdmin , setIsAdmin ] = useState < boolean > ( false ) ;
19
- const [ password , setPassword ] = useState < string > ( "" )
18
+ const [ password , setPassword ] = useState < string > ( "" ) ;
20
19
21
- const clickHandler = ( e : any ) => {
20
+ const clickHandler = ( ) => {
22
21
if ( process . env . NEXT_PUBLIC_ADMIN_PASSWORD === password ) {
23
22
setIsAdmin ( true ) ;
24
23
}
@@ -35,7 +34,7 @@ const secret: NextPage = () => {
35
34
placeholder = "password"
36
35
className = "block w-50 rounded-md border border-gray-300 px-5 py-3 text-base text-gray-900 placeholder-gray-500 shadow-sm focus:border-rose-500 focus:ring-rose-500 mr-8" >
37
36
</ input >
38
- < button onClick = { e => clickHandler ( e ) } className = "blockrounded-md border rounded border-transparent bg-rose-500 px-5 py-3 text-base font-medium text-white shadow hover:bg-rose-600 focus:outline-none focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 sm:px-10" > Submit</ button >
37
+ < button onClick = { clickHandler } className = "blockrounded-md border rounded border-transparent bg-rose-500 px-5 py-3 text-base font-medium text-white shadow hover:bg-rose-600 focus:outline-none focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 sm:px-10" > Submit</ button >
39
38
</ div > }
40
39
{ isAdmin && < div > You logged in!</ div > }
41
40
You can’t perform that action at this time.
0 commit comments