Skip to content

Commit

Permalink
fix login and signup screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadjaur committed Sep 10, 2024
1 parent e7174de commit c2f4533
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 39 deletions.
38 changes: 22 additions & 16 deletions packages/app/modules/auth/screens/LoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import useTheme from '../../../hooks/useTheme';
import { useGoogleAuth, useLogin } from 'app/modules/auth';
import { SignInScreen } from '@packrat/ui/src/Bento/forms/layouts';
import { View } from 'react-native';
import { ScrollView } from 'react-native';

const demoUser = {
email: '[email protected]',
Expand Down Expand Up @@ -35,25 +36,30 @@ export function LoginScreen() {
<View
style={{
width: '100%',
alignItems: 'center',
height: '100%',
backgroundColor: currentTheme.colors.background,
}}
>
<View
style={{
paddingTop: 32,
paddingBottom: 32,
width: '90%',
maxWidth: 400,
}}
>
<SignInScreen
promptAsync={promptAsync}
signIn={signIn}
signInStatus={signInStatus}
isGoogleSignInReady={isGoogleSignInReady}
/>
</View>
<ScrollView>
<View
style={{
paddingTop: 32,
paddingBottom: 32,
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
width: '90%',
maxWidth: 400,
}}
>
<SignInScreen
promptAsync={promptAsync}
signIn={signIn}
signInStatus={signInStatus}
isGoogleSignInReady={isGoogleSignInReady}
/>
</View>
</ScrollView>
</View>
);
}
39 changes: 22 additions & 17 deletions packages/app/modules/auth/screens/RegisterScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react';
import { View } from 'react-native';
import useTheme from 'app/hooks/useTheme';
import { useRegisterUser, useGoogleAuth } from 'app/modules/auth';
import { SignUpScreen } from '@packrat/ui/src/Bento/forms/layouts';
import { useState } from 'react';
import { ScrollView } from 'react-native';

export function RegisterScreen() {
const { currentTheme } = useTheme();
Expand All @@ -29,26 +31,29 @@ export function RegisterScreen() {
<View
style={{
width: '100%',
alignItems: 'center',
backgroundColor: currentTheme.colors.background,
}}
>
<View
style={{
paddingTop: 32,
paddingBottom: 32,
height: '100%',
width: '90%',
maxWidth: 400,
}}
>
<SignUpScreen
promptAsync={promptAsync}
signup={signup}
signUpStatus={signUpStatus}
isGoogleSignInReady={isGoogleSignInReady}
/>
</View>
<ScrollView>
<View
style={{
paddingTop: 32,
paddingBottom: 32,
alignItems: 'center',
alignSelf: 'center',
height: '100%',
width: '90%',
maxWidth: 400,
}}
>
<SignUpScreen
promptAsync={promptAsync}
signup={signup}
signUpStatus={signUpStatus}
isGoogleSignInReady={isGoogleSignInReady}
/>
</View>
</ScrollView>
</View>
);
}
14 changes: 8 additions & 6 deletions packages/ui/src/Bento/forms/layouts/SignInScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import * as LocalAuthentication from 'expo-local-authentication';
import {
AnimatePresence,
Expand Down Expand Up @@ -71,13 +72,14 @@ export function SignInScreen({
return (
<FormCard>
<View
flexDirection="column"
alignItems="stretch"
minWidth="100%"
maxWidth="100%"
fd="column"
f={1}
ai="stretch"
miw="100%"
maw="100%"
gap="$4"
padding="$4"
paddingVertical="$14"
p="$4"
py="$14"
$group-window-gtSm={{
paddingVertical: '$4',
width: 400,
Expand Down

0 comments on commit c2f4533

Please sign in to comment.