|
|
|
@ -71,10 +71,11 @@ export const GetDeviceCode = () => { |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
{(context.gitHubUser && context.gitHubUser.login) ? null : |
|
|
|
|
{(context.gitHubUser && context.gitHubUser.login) ? null : <> |
|
|
|
|
<label className="text-uppercase">Connect to GitHub</label> |
|
|
|
|
<button className='btn btn-secondary mt-1 w-100' onClick={async () => { |
|
|
|
|
await getDeviceCodeFromGitHub() |
|
|
|
|
}}><i className="fab fa-github mr-1"></i>Login in with github</button> |
|
|
|
|
}}><i className="fab fa-github mr-1"></i>Login in with github</button></> |
|
|
|
|
} |
|
|
|
|
{gitHubResponse && !authorized && |
|
|
|
|
<div className="pt-2"> |
|
|
|
@ -109,15 +110,15 @@ export const GetDeviceCode = () => { |
|
|
|
|
<div className="pt-2"> |
|
|
|
|
<Card> |
|
|
|
|
<Card.Body className="p-2"> |
|
|
|
|
<div className="mb-1" data-id={`connected-as-${context.gitHubUser.login}`}>Connected as {context.gitHubUser.login}</div> |
|
|
|
|
<div className="mb-1" data-id={`connected-as-${context.gitHubUser.login}`}>Connected as {context.gitHubUser.login}</div> |
|
|
|
|
<Card.Text> |
|
|
|
|
<img data-id={`connected-img-${context.gitHubUser.login}`} src={context.gitHubUser.avatar_url} className="w-25" /> |
|
|
|
|
<br></br> |
|
|
|
|
|
|
|
|
|
<a data-id={`connected-link-${context.gitHubUser.login}`} href={context.gitHubUser.html_url}>{context.gitHubUser.html_url}</a> |
|
|
|
|
{context.userEmails && context.userEmails.filter((email: any) => email.primary).map((email: any) => { |
|
|
|
|
return <span key={email.email}><br></br>{email.email}</span> |
|
|
|
|
})} |
|
|
|
|
|
|
|
|
|
<a data-id={`connected-link-${context.gitHubUser.login}`} href={context.gitHubUser.html_url}>{context.gitHubUser.html_url}</a> |
|
|
|
|
{context.userEmails && context.userEmails.filter((email: any) => email.primary).map((email: any) => { |
|
|
|
|
return <span key={email.email}><br></br>{email.email}</span> |
|
|
|
|
})} |
|
|
|
|
</Card.Text> |
|
|
|
|
</Card.Body> |
|
|
|
|
</Card> |
|
|
|
|