generated from melaasar/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Saagar3690/frontend
Frontend
- Loading branch information
Showing
10 changed files
with
202 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.DS_Store | ||
.DS_Store | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useEffect } from 'react'; | ||
|
||
const GoogleSignInButton = () => { | ||
const handleCredentialResponse = (response) => { | ||
console.log("Encoded JWT ID token: " + response.credential); | ||
}; | ||
|
||
useEffect(() => { | ||
const initGoogleSignIn = () => { | ||
window.google.accounts.id.initialize({ | ||
client_id: "YOUR_GOOGLE_CLIENT_ID", | ||
callback: handleCredentialResponse | ||
}); | ||
window.google.accounts.id.renderButton( | ||
document.getElementById("buttonDiv"), | ||
{ theme: "outline", size: "large" } // customization attributes | ||
); | ||
window.google.accounts.id.prompt(); // also display the One Tap dialog | ||
}; | ||
|
||
if (!window.google || !window.google.accounts || !window.google.accounts.id) { | ||
// Load the Google Sign-In API script | ||
const script = document.createElement("script"); | ||
script.src = "https://accounts.google.com/gsi/client"; | ||
script.async = true; | ||
script.onload = initGoogleSignIn; | ||
document.body.appendChild(script); | ||
} else { | ||
initGoogleSignIn(); | ||
} | ||
}, []); // Empty dependency array to run the effect only once on mount | ||
|
||
return ( | ||
<div id="buttonDiv"></div> | ||
); | ||
} | ||
|
||
export default GoogleSignInButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import { Link } from 'react-router-dom'; | ||
import styled from 'styled-components' | ||
|
||
const Logo = styled.h1` | ||
font-size: 120px; | ||
font-family: 'Bungee', sans-serif; | ||
color: black; | ||
text-align: center; | ||
margin: auto; | ||
padding-top: 1.5em; | ||
` | ||
|
||
const ButtonContainer = styled.div` | ||
display: flex; | ||
margin: auto; | ||
justify-content: center; | ||
` | ||
|
||
const Button = styled.button ` | ||
padding: 10px 1em; | ||
margin: 2em; | ||
width: 20vw; | ||
border-radius: 20px; | ||
background-color: #f0ada8; | ||
font-size: 30px; | ||
font-family: 'Concert One', sans-serif; | ||
` | ||
|
||
export default function Landing() { | ||
return ( | ||
<div> | ||
<Logo>EXCQL</Logo> | ||
<ButtonContainer> | ||
<Link to = "/login"> | ||
<Button> Login </Button> | ||
</Link> | ||
<Link to = "/signup"> | ||
<Button> New User </Button> | ||
</Link> | ||
</ButtonContainer> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import GoogleSignInButton from './GoogleSignInButton'; | ||
|
||
export default function Login() { | ||
return ( | ||
<div> | ||
<GoogleSignInButton></GoogleSignInButton> | ||
<div> | ||
Here | ||
</div> | ||
</div> | ||
) | ||
} |