Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 committed Oct 25, 2024
1 parent 891b464 commit 004471b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
11 changes: 11 additions & 0 deletions apps/languagesv2/languages-v2-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/languagesv2/languages-v2-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"homepage": "./",
"private": true,
"dependencies": {
"@react-oauth/google": "^0.12.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
42 changes: 30 additions & 12 deletions apps/languagesv2/languages-v2-web/src/pages/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { GoogleOAuthProvider, GoogleLogin } from '@react-oauth/google';

const Nav: React.FC = () => {
const handleGoogleLoginSuccess = (response: any) => {
console.log('Google login successful:', response);
// Handle the Google login response here, e.g., send the token to your backend for verification.
};

const handleGoogleLoginError = () => {
console.log('Google login failed');
};

return (
<nav className="w-full p-4 bg-white shadow-md fixed top-0 z-50">
<ul className="flex justify-start space-x-8">
<li>
<Link
to="/"
className="text-blue-600 font-semibold hover:text-blue-800 transition duration-300 ease-in-out px-4 py-2 rounded-md hover:bg-blue-100"
>
Languages
</Link>
</li>
</ul>
</nav>
<GoogleOAuthProvider clientId="1019763033940-c42boad0dt819pddir1g4jelvarm8802.apps.googleusercontent.com">
<nav className="w-full p-4 bg-white shadow-md fixed top-0 z-50">
<ul className="flex justify-start space-x-8">
<li>
<Link
to="/"
className="text-blue-600 font-semibold hover:text-blue-800 transition duration-300 ease-in-out px-4 py-2 rounded-md hover:bg-blue-100"
>
Languages
</Link>
</li>
<li>
<GoogleLogin
onSuccess={handleGoogleLoginSuccess}
onError={handleGoogleLoginError}
/>
</li>
</ul>
</nav>
</GoogleOAuthProvider>
);
};

Expand Down

0 comments on commit 004471b

Please sign in to comment.