11const { ipcRenderer } = require ( 'electron' ) ;
22
3- import React , { useCallback , useContext , useEffect } from 'react' ;
3+ import React , { useContext , useEffect } from 'react' ;
44import { useNavigate } from 'react-router-dom' ;
55
66import { AppContext } from '../context/App' ;
77import { Logo } from '../components/Logo' ;
88
99export const LoginRoute : React . FC = ( ) => {
1010 const navigate = useNavigate ( ) ;
11- const { isLoggedIn, login } = useContext ( AppContext ) ;
11+ const { isLoggedIn } = useContext ( AppContext ) ;
1212
1313 useEffect ( ( ) => {
1414 if ( isLoggedIn ) {
@@ -17,16 +17,17 @@ export const LoginRoute: React.FC = () => {
1717 }
1818 } , [ isLoggedIn ] ) ;
1919
20- const loginUser = useCallback ( async ( ) => {
20+ // FIXME: Temporarily disable Login with GitHub (OAuth) as it's currently broken and requires a rewrite - see #485 #561 #747
21+ /* const loginUser = useCallback(async () => {
2122 try {
2223 await login();
2324 } catch (err) {
2425 // Skip
2526 }
26- } , [ ] ) ;
27+ }, []); */
2728
2829 const loginButtonClass =
29- 'w-48 py-2 my-2 bg-gray-300 font-semibold rounded text-xs text-center dark:text-black hover:bg-gray-500 hover:text-white focus:outline-none' ;
30+ 'w-50 px-2 py-2 my-2 bg-gray-300 font-semibold rounded text-xs text-center dark:text-black hover:bg-gray-500 hover:text-white focus:outline-none' ;
3031
3132 return (
3233 < div className = "flex flex-1 flex-col justify-center items-center p-4 bg-white dark:bg-gray-dark dark:text-white" >
@@ -36,13 +37,26 @@ export const LoginRoute: React.FC = () => {
3637 GitHub Notifications < br /> on your menu bar.
3738 </ div >
3839
40+ {
41+ // FIXME: Temporarily disable Login with GitHub (OAuth) as it's currently broken and requires a rewrite - see #485 #561 #747
42+ /*
3943 <button
4044 className={loginButtonClass}
4145 title="Login with GitHub"
4246 aria-label="Login with GitHub"
4347 onClick={loginUser}
4448 >
4549 Login to GitHub
50+ </button> */
51+ }
52+
53+ < button
54+ className = { loginButtonClass }
55+ title = "Login with Personal Token"
56+ aria-label = "Login with Personal Token"
57+ onClick = { ( ) => navigate ( '/login-token' ) }
58+ >
59+ Login with Personal Access Token
4660 </ button >
4761
4862 < button
@@ -53,15 +67,6 @@ export const LoginRoute: React.FC = () => {
5367 >
5468 Login to GitHub Enterprise
5569 </ button >
56-
57- < button
58- className = "bg-none hover:text-gray-800 dark:text-gray-100 dark:hover:text-gray-300 mt-4 focus:outline-none"
59- title = "Login with Personal Token"
60- aria-label = "Login with Personal Token"
61- onClick = { ( ) => navigate ( '/login-token' ) }
62- >
63- < small > or login with a personal token</ small >
64- </ button >
6570 </ div >
6671 ) ;
6772} ;
0 commit comments