feat: add navigation to screens
This commit is contained in:
parent
d7ecc37887
commit
ac7f5aa63e
2 changed files with 19 additions and 2 deletions
|
|
@ -1,11 +1,20 @@
|
||||||
import { Center, Heading, Image, ScrollView, Text, VStack } from "@gluestack-ui/themed";
|
import { Center, Heading, Image, ScrollView, Text, VStack } from "@gluestack-ui/themed";
|
||||||
|
import { useNavigation } from "@react-navigation/native";
|
||||||
|
|
||||||
import BackgroundImg from '@assets/background.png';
|
import BackgroundImg from '@assets/background.png';
|
||||||
import Logo from '@assets/logo.svg';
|
import Logo from '@assets/logo.svg';
|
||||||
|
|
||||||
import { Input } from "@components/Input";
|
import { Input } from "@components/Input";
|
||||||
import { Button } from "@components/Button";
|
import { Button } from "@components/Button";
|
||||||
|
import { AuthNavigatorRoutesProps } from "@routes/auth.routes";
|
||||||
|
|
||||||
export function SignIn() {
|
export function SignIn() {
|
||||||
|
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
||||||
|
|
||||||
|
function handleNewAccount() {
|
||||||
|
navigation.navigate('SignUp');
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={{ flexGrow: 1 }}
|
contentContainerStyle={{ flexGrow: 1 }}
|
||||||
|
|
@ -66,7 +75,7 @@ export function SignIn() {
|
||||||
Ainda não tem acesso?
|
Ainda não tem acesso?
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Button title="Criar Conta" variant="outline" />
|
<Button title="Criar Conta" variant="outline" onPress={handleNewAccount} />
|
||||||
</Center>
|
</Center>
|
||||||
</VStack>
|
</VStack>
|
||||||
</VStack>
|
</VStack>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
import { Center, Heading, Image, ScrollView, Text, VStack } from "@gluestack-ui/themed";
|
import { Center, Heading, Image, ScrollView, Text, VStack } from "@gluestack-ui/themed";
|
||||||
|
import { useNavigation } from "@react-navigation/native";
|
||||||
|
|
||||||
import BackgroundImg from '@assets/background.png';
|
import BackgroundImg from '@assets/background.png';
|
||||||
import Logo from '@assets/logo.svg';
|
import Logo from '@assets/logo.svg';
|
||||||
import { Input } from "@components/Input";
|
import { Input } from "@components/Input";
|
||||||
import { Button } from "@components/Button";
|
import { Button } from "@components/Button";
|
||||||
|
import { AuthNavigatorRoutesProps } from "@routes/auth.routes";
|
||||||
|
|
||||||
export function SignUp() {
|
export function SignUp() {
|
||||||
|
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
||||||
|
|
||||||
|
const handleLogin = () => {
|
||||||
|
navigation.navigate('SignIn');
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={{ flexGrow: 1 }}
|
contentContainerStyle={{ flexGrow: 1 }}
|
||||||
|
|
@ -57,7 +65,7 @@ export function SignUp() {
|
||||||
/>
|
/>
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
<Button title="Voltar para o login" mt="$12" variant="outline" />
|
<Button title="Voltar para o login" mt="$12" variant="outline" onPress={handleLogin} />
|
||||||
</VStack>
|
</VStack>
|
||||||
</VStack>
|
</VStack>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue