import { Button } from '@material-tailwind/react'; import React from 'react'; import OauthPopup from 'react-oauth-popup'; import { useGQLClient } from '../../../context/GQLClientContext'; const SCOPES = 'repo user'; const GITHUB_OAUTH_URL = `https://github.com/login/oauth/authorize?client_id=${ process.env.REACT_APP_GITHUB_CLIENT_ID }&scope=${encodeURIComponent(SCOPES)}`; interface ConnectAccountInterface { onToken: (token: string) => void; } const ConnectAccount = ({ onToken }: ConnectAccountInterface) => { const client = useGQLClient(); const handleCode = async (code: string) => { // Pass code to backend and get access token const { authenticateGithub: { token }, } = await client.authenticateGithub(code); onToken(token); }; return (
^

Connect to your git account

Once connected, you can create projects by importing repositories under the account

{}} title="Snowball" width={1000} height={1000} >
); }; export default ConnectAccount;