-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): beautify auth screen (#58)
- Loading branch information
Showing
21 changed files
with
636 additions
and
86 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
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,16 +1,54 @@ | ||
import { Button } from '@/components/Button' | ||
import { Separator } from '@/components/Separator' | ||
import { AuthEmail } from '@/components/auth/auth-email' | ||
import { ScrollView, Text } from 'react-native' | ||
import { | ||
AppleAuthButton, | ||
GoogleAuthButton, | ||
} from '@/components/auth/auth-social' | ||
import { AuthIllustration } from '@/components/svg-assets/auth-illustration' | ||
import { Link } from 'expo-router' | ||
import { MailIcon } from 'lucide-react-native' | ||
import { useState } from 'react' | ||
import { ScrollView, Text, View } from 'react-native' | ||
|
||
export default function LoginScreen() { | ||
const [withEmail, setWithEmail] = useState(false) | ||
return ( | ||
<ScrollView className="bg-card p-6" contentContainerClassName="gap-4"> | ||
<ScrollView | ||
className="bg-card" | ||
contentContainerClassName="gap-4 p-8" | ||
automaticallyAdjustKeyboardInsets | ||
keyboardShouldPersistTaps="handled" | ||
> | ||
<Text className="text-3xl font-semibold font-sans"> | ||
Manage your expense seamlessly | ||
</Text> | ||
<Text className="text-muted-foreground font-sans"> | ||
Let <Text className="text-primary">6pm</Text> a good time to spend | ||
</Text> | ||
<AuthEmail /> | ||
<AuthIllustration className="h-[326px] my-16" /> | ||
<View className="flex flex-col gap-3"> | ||
<AppleAuthButton /> | ||
<GoogleAuthButton /> | ||
<Button | ||
label="Continue with Email" | ||
leftIcon={MailIcon} | ||
variant="outline" | ||
onPress={() => setWithEmail(true)} | ||
/> | ||
<Separator className="w-[70%] mx-auto my-3" /> | ||
{withEmail && <AuthEmail />} | ||
</View> | ||
<Text className="font-sans text-muted-foreground text-xs text-center mx-auto px-4 mt-4"> | ||
By continuing, you acknowledge that you understand and agree to the{' '} | ||
<Link href="/terms-of-service" asChild className="text-primary"> | ||
<Text>Terms & Conditions</Text> | ||
</Link>{' '} | ||
and{' '} | ||
<Link href="/privacy-policy" asChild className="text-primary"> | ||
<Text>Privacy Policy</Text> | ||
</Link> | ||
</Text> | ||
</ScrollView> | ||
) | ||
} |
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,5 @@ | ||
import { Text } from 'react-native' | ||
|
||
export default function PrivacyScreen() { | ||
return <Text className="font-sans m-4 mx-auto">Privacy Policy</Text> | ||
} |
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,7 @@ | ||
import { Text } from 'react-native' | ||
|
||
export default function TermsScreen() { | ||
return ( | ||
<Text className="font-sans m-4 mx-auto">Terms & Conditions</Text> | ||
) | ||
} |
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,85 @@ | ||
import { type VariantProps, cva } from 'class-variance-authority' | ||
import { TouchableOpacity } from 'react-native' | ||
|
||
import type { SvgProps } from 'react-native-svg' | ||
import { cn } from '../lib/utils' | ||
|
||
const buttonVariants = cva( | ||
'flex flex-row items-center gap-2 justify-center rounded-md', | ||
{ | ||
variants: { | ||
variant: { | ||
default: 'bg-primary', | ||
secondary: 'bg-secondary', | ||
outline: 'border-border border', | ||
destructive: 'bg-destructive', | ||
ghost: 'bg-transparent', | ||
link: 'text-primary underline-offset-4', | ||
}, | ||
size: { | ||
default: 'h-12 w-12', | ||
sm: 'h-8 w-8', | ||
lg: 'h-14 w-14', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'default', | ||
size: 'default', | ||
}, | ||
}, | ||
) | ||
|
||
const iconVariants = cva('text-center font-medium font-sans', { | ||
variants: { | ||
variant: { | ||
default: 'text-primary-foreground', | ||
secondary: 'text-secondary-foreground', | ||
outline: 'text-primary', | ||
destructive: 'text-destructive-foreground', | ||
ghost: 'text-primary', | ||
link: 'text-primary-foreground underline', | ||
}, | ||
size: { | ||
default: 'text-base', | ||
sm: 'w-5 h-5', | ||
lg: 'text-xl', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'default', | ||
size: 'default', | ||
}, | ||
}) | ||
|
||
export interface IconButtonProps | ||
extends React.ComponentPropsWithoutRef<typeof TouchableOpacity>, | ||
VariantProps<typeof buttonVariants> { | ||
icon: React.ComponentType<SvgProps> | ||
iconClasses?: string | ||
} | ||
function IconButton({ | ||
icon: Icon, | ||
iconClasses, | ||
className, | ||
variant, | ||
size, | ||
disabled, | ||
...props | ||
}: IconButtonProps) { | ||
return ( | ||
<TouchableOpacity | ||
activeOpacity={0.8} | ||
className={cn(buttonVariants({ variant, size, className }), { | ||
'opacity-50': disabled, | ||
})} | ||
disabled={disabled} | ||
{...props} | ||
> | ||
<Icon | ||
className={cn(iconVariants({ variant, size, className: iconClasses }))} | ||
/> | ||
</TouchableOpacity> | ||
) | ||
} | ||
|
||
export { IconButton, buttonVariants, iconVariants } |
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.