Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of the Google OAuth on the frontend #80

Merged
merged 28 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
638fccb
Corrected npm start command in README.md for local development
mayura-andrew Jan 2, 2024
04537ab
Merge branch 'sef-global:main' into main
mayura-andrew Jan 4, 2024
638ec27
Fixed README
mayura-andrew Jan 4, 2024
0a2cddf
Merge branch 'sef-global:main' into main
mayura-andrew Jan 9, 2024
335507c
Fixed Facebook icon in nav bar and Apply button issue
mayura-andrew Jan 9, 2024
f6fea0b
Fixed Apply button and See more button used TailwindCSS
mayura-andrew Jan 10, 2024
92a661b
Backend API URL Problem
mayura-andrew Jan 10, 2024
32595c8
Fixed Apply button and See more buttons (Removed template iterals)
mayura-andrew Jan 11, 2024
c26820e
Connect with Backend API
mayura-andrew Jan 11, 2024
1e5b97f
added \
mayura-andrew Jan 11, 2024
a9666e9
Added environment variable to connect backend api
mayura-andrew Jan 11, 2024
dfc7028
Fixed typos in README
mayura-andrew Jan 11, 2024
4f86fd0
added .end to .gitignore
mayura-andrew Jan 11, 2024
0bf8c9f
Merge branch 'main' into main
mayura-andrew Jan 11, 2024
5fc0a50
fixed typos in example.env file
mayura-andrew Jan 11, 2024
c07988c
changed API_URL setup
mayura-andrew Jan 11, 2024
0516513
Fixed example.env
mayura-andrew Jan 11, 2024
2459152
Stop tracking .env file
mayura-andrew Jan 12, 2024
46118e6
fixed "Become a menter" button using Tailwind
mayura-andrew Jan 13, 2024
4df0cda
Merge branch 'sef-global:main' into main
mayura-andrew Jan 13, 2024
16c2662
Fixed that "Become a Mentor" button issue in MenuDrawer
mayura-andrew Jan 13, 2024
66bfb48
Fixed LoginModal mobile responsiveness
mayura-andrew Jan 14, 2024
ad14b9e
Merge branch 'sef-global:main' into main
mayura-andrew Jan 16, 2024
0e1b085
Merge branch 'sef-global:main' into main
mayura-andrew Jan 31, 2024
f543b33
Google OAuth integerate
mayura-andrew Feb 1, 2024
a4ff0c1
Implemented Google Sign-in button
mayura-andrew Feb 2, 2024
a989437
Merge branch 'sef-global:main' into main
mayura-andrew Feb 8, 2024
c26d3d6
changed tailwind css
mayura-andrew Feb 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_API_URL=http://localhost:4000/api
VITE_API_URL=http://localhost:3000/api
24 changes: 24 additions & 0 deletions src/components/LoginModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ interface LoginModalProps {
handleClose: () => void;
}

const handleLoginGoogle = (e: React.FormEvent): void => {
e.preventDefault();
window.location.href = `${API_URL}/auth/google`;
};

const LoginModal: React.FC<LoginModalProps> = ({ handleClose }) => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
Expand Down Expand Up @@ -140,6 +145,25 @@ const LoginModal: React.FC<LoginModalProps> = ({ handleClose }) => {
>
Login
</button>
<div className="my-1 m-0 flex items-center before:mt-0.2 before:flex-1 before:border-t before:border-neutral-300 after:mt-0.5 after:flex-1 after:border-t after:border-neutral-300">
<p className="mx-1 mb-0 text-center font-semibold text-gray-400">
or Sign-in with
</p>
</div>
<div className="m-0 items-center flex justify-center">
<button
onClick={handleLoginGoogle}
className="px-10 py-1.5 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-700 dark:text-black hover:border-gray-400 dark:hover:border-gray-500 hover:text-gray-900 dark:hover:text-gray-300 hover:shadow transition duration-150 flex items-center gap-2"
>
<img
className="w-4 h-4"
src="https://www.svgrepo.com/show/475656/google-color.svg"
loading="lazy"
alt="google logo"
/>
<span>Google</span>
</button>
</div>
<div className="text-sm font-thin text-center text-gray-900">
Not registered yet?{' '}
<a className="font-medium text-black hover:underline">
Expand Down
Loading