Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 11 additions & 4 deletions client/screens/LoginScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import {
NativeBaseProvider,
} from "native-base";


import { FontAwesome } from "@expo/vector-icons";

import * as WebBrowser from 'expo-web-browser';
import * as Google from 'expo-auth-session/providers/google';
import { useState, useEffect } from "react";
import useLogin from "../hooks/useLogin";
import { useAuth } from "../auth/provider";
Expand Down Expand Up @@ -117,7 +122,7 @@ export default function Login() {
Or
</Heading>
</HStack>
<HStack mt="1" justifyContent="center">
<HStack mt="1" justifyContent="center" alignItems="center">
<Button
w="100%"
onPress={() => {
Expand All @@ -134,10 +139,12 @@ export default function Login() {
console.log(err)
})
}}
mt="2"
colorScheme="red"
colorScheme={"red"}
startIcon={
<FontAwesome name="google" size={18} color="white" />
}
>
{"Sign in with Google"}
Sign in with Google
</Button>
</HStack>
{/* Google Login */}
Expand Down
14 changes: 12 additions & 2 deletions client/screens/RegisterScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import {
View
} from "native-base";

import { FontAwesome } from '@expo/vector-icons';
import * as WebBrowser from 'expo-web-browser';
import * as Google from 'expo-auth-session/providers/google';

import { useState, useEffect } from "react";
import useRegister from "../hooks/useRegister";
import { useRouter } from "expo-router";
Expand Down Expand Up @@ -110,10 +114,16 @@ export default function Register() {
Or
</Heading>
</HStack>
<HStack mt="1" justifyContent="center">
<HStack mt="1" justifyContent="center" alignItems="center">
<Button
w="100%"
onPress={() => {
promptAsync();
}}
colorScheme={"red"}
startIcon={
<FontAwesome name="google" size={16} color="white" />
}
signInWithGoogle().then(async (res) => {
let { email, name } = res
if (email && name) {
Expand All @@ -128,7 +138,7 @@ export default function Register() {
}} mt="2"
colorScheme="red"
>
{"Sign up with google"}
Sign up with Google
</Button>
</HStack>
{/* Google register */}
Expand Down