A tool to migrate GitHub Repositories to Gitea including all issues
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
gitea-github-migrator/frontend/src/components/GitHubButton.tsx

39 lines
845 B

import * as React from "react";
import { Button, Icon } from "semantic-ui-react";
import { client } from "../configuration";
export interface IGitHubButtonState {
loading: boolean;
}
export class GitHubButton extends React.Component<{}, IGitHubButtonState> {
constructor(props: {}) {
super(props);
this.state = {
loading: false
};
}
render() {
return (
<Button
icon
loading={this.state.loading}
disabled={this.state.loading}
labelPosition="left"
onClick={this.submitToGitHub}
>
<Icon name="github" />
Login with GitHub
</Button>
);
}
submitToGitHub() {
this.setState({ loading: true });
client.getGitHubRedirect().then(res => {
this.setState({ loading: false });
window.location.href = res.url;
});
}
}