-
Notifications
You must be signed in to change notification settings - Fork 0
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 #54 from UNLV-CS472-672/19-frontend-login-dashboar…
…d-page-real 19 frontend login page
- Loading branch information
Showing
28 changed files
with
242 additions
and
37 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
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
Binary file not shown.
Binary file modified
BIN
+100 Bytes
(100%)
apps/expo/android/.gradle/8.0.1/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified
BIN
+108 Bytes
(100%)
apps/expo/android/.gradle/8.0.1/checksums/sha1-checksums.bin
Binary file not shown.
Binary file modified
BIN
+1.2 MB
(110%)
apps/expo/android/.gradle/8.0.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
apps/expo/android/.gradle/8.0.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+1.26 KB
(100%)
apps/expo/android/.gradle/8.0.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
apps/expo/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified
BIN
+39.6 KB
(110%)
apps/expo/android/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file not shown.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,26 @@ | ||
import React from 'react' | ||
import { ImageBackground, Text, View } from 'react-native' | ||
import SignInWithGoogle from '~/components/auth/sign-in-w-google' | ||
|
||
const AuthScreen = () => { | ||
return ( | ||
<ImageBackground | ||
source={require('assets/auth/background.png')} | ||
style={{ flex: 1, backgroundColor: '#1E1E1E' }} | ||
resizeMode="cover" | ||
> | ||
<View className="flex-1 items-center justify-center rounded-md"> | ||
<View className="scale-150 rounded-lg bg-white p-7"> | ||
<Text | ||
className="font-koulen mb-1 text-center text-[3.70rem] m-2 font-semibold" | ||
> | ||
BARBELL | ||
</Text> | ||
<SignInWithGoogle /> | ||
</View> | ||
</View> | ||
</ImageBackground> | ||
) | ||
} | ||
|
||
export default AuthScreen |
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,76 @@ | ||
import React from 'react' | ||
import { Alert, StyleSheet, Text, TouchableOpacity } from 'react-native' | ||
import { router } from 'expo-router' | ||
import * as WebBrowser from 'expo-web-browser' | ||
import { useOAuth } from '@clerk/clerk-expo' | ||
|
||
import { useWarmUpBrowser } from '~/hooks/useWarmUpBrowser' | ||
|
||
WebBrowser.maybeCompleteAuthSession() | ||
|
||
const SignInWithGoogle = () => { | ||
// Warm up the android browser to improve UX | ||
// https://docs.expo.dev/guides/authentication/#improving-user-experience | ||
useWarmUpBrowser() | ||
|
||
const { startOAuthFlow: startGoogleOAuthFlow } = useOAuth({ | ||
strategy: 'oauth_google', | ||
}) | ||
|
||
// add mores strategies here | ||
const onPressOAuth = React.useCallback(async () => { | ||
try { | ||
const startOAuthFlow = startGoogleOAuthFlow | ||
|
||
const { createdSessionId, setActive } = await startOAuthFlow() | ||
console.log('startOAuthFlow') | ||
|
||
if (createdSessionId) { | ||
setActive?.({ session: createdSessionId }) | ||
router.back() | ||
} else { | ||
alert('Sign in failed') | ||
} | ||
} catch (err: any) { | ||
Alert.alert( | ||
'OAuth Error', | ||
`An error occurred during the OAuth process: ${err.message || err}`, | ||
) | ||
console.error('OAuth error', err) | ||
} | ||
}, []) | ||
|
||
return ( | ||
<> | ||
<TouchableOpacity | ||
onPress={() => onPressOAuth()} | ||
className="mb-4 rounded-xl bg-[#1C1B1B] py-1" | ||
> | ||
<Text className="font-koulen text-center text-xl font-semibold text-white"> | ||
SIGN IN | ||
</Text> | ||
</TouchableOpacity> | ||
|
||
<TouchableOpacity | ||
onPress={() => onPressOAuth()} | ||
className="rounded-xl bg-[#48476D] py-1" | ||
> | ||
<Text className="font-koulen text-center text-xl font-semibold text-white"> | ||
SIGN UP | ||
</Text> | ||
</TouchableOpacity> | ||
</> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
padding: 20, | ||
}, | ||
// Additional styles can be added here if needed | ||
}) | ||
|
||
export default SignInWithGoogle |
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 |
---|---|---|
@@ -1,10 +1,34 @@ | ||
import type { Config } from "tailwindcss" | ||
import type { Config } from 'tailwindcss' | ||
// @ts-expect-error - no types | ||
import nativewind from "nativewind/preset" | ||
import nativewind from 'nativewind/preset' | ||
|
||
import baseConfig from "@acme/tailwind-config/native" | ||
import baseConfig from '@acme/tailwind-config/native' | ||
|
||
export default { | ||
content: ["./src/**/*.{ts,tsx}"], | ||
content: ['./src/**/*.{ts,tsx}'], | ||
presets: [baseConfig, nativewind], | ||
theme: { | ||
extend: { | ||
fontFamily: { | ||
koulen: ['Koulen_400Regular'], | ||
}, | ||
fontSize: { | ||
xs : '0.75rem', // 12px | ||
sm : '0.875rem', // 14px | ||
base : '1rem', // 16px | ||
lg : '1.125rem', // 18px | ||
xl : '1.25rem', // 20px | ||
'2xl' : '1.5rem', // 24px | ||
'3xl' : '1.875rem', // 30px | ||
'4xl' : '2.25rem', // 36px | ||
'5.5xl': '2.75rem', // 44px | ||
'5xl' : '3rem', // 48px | ||
'6xl' : '3.75rem', // 60px | ||
'6.5xl' : '4rem', // 64px | ||
'7xl' : '4.5rem', // 72px | ||
'8xl' : '6rem', // 96px | ||
'9xl' : '8rem', // 128px | ||
}, | ||
}, | ||
}, | ||
} satisfies Config |
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
Oops, something went wrong.