Skip to content

Commit

Permalink
github auth complete
Browse files Browse the repository at this point in the history
  • Loading branch information
saviomartin committed Jun 6, 2021
1 parent 5dac994 commit 0af0bd8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,23 @@ const Header = ({ setOpen, user, setUser }) => {
New CheetSheet
</div>
</Button>
{user.displayName ? (
{user.email ? (
<>
<Button
className="!p-0 !w-auto !h-auto !m-auto !ml-2"
onClick={(e) => setAnchorEl(e.currentTarget)}
>
<div className="bg-[#F5BA31] p-[6px] text-md capitalize rounded-md font-semibold flex items-center justify-center">
<div className="bg-[#F5BA31] p-[6px] pr-[8px] text-md capitalize rounded-md font-semibold flex items-center justify-center">
<img
src={user.photoURL}
src={
user.photoURL
? user.photoURL
: `https://unavatar.vercel.app/${user.email}`
}
alt=""
className="h-7 w-7 rounded-md mr-1"
className="h-7 w-7 rounded-md mr-2"
/>
{user.displayName}
{user.displayName ? user.displayName : "User"}
</div>
</Button>
<Menu
Expand Down
3 changes: 2 additions & 1 deletion components/SignInPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const SignInPopup = ({ open, setOpen }) => {
const handleOnClick = async (provider) => {
const res = await socialMediaAuth(provider);
await setOpen(false);
await console.log(res);
};

return (
Expand All @@ -29,7 +30,7 @@ const SignInPopup = ({ open, setOpen }) => {
<h1 className="text-3xl font-bold mb-2">Join Codehouse!</h1>
<p className="text-[#555] mb-5">
We're super excited to have you here! Welcome to Code House. I hope
you have fun, Sgn In with any of the following methods✌️
you have fun, Sign In with any of the following methods✌️
</p>
<div className="flex">
<Btn>
Expand Down
1 change: 1 addition & 0 deletions utils/Auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const socialMediaAuth = (provider) => {
})
.catch((err) => {
return err;
console.log(err);
});
};

Expand Down

1 comment on commit 0af0bd8

@vercel
Copy link

@vercel vercel bot commented on 0af0bd8 Jun 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.