feat: add name and email inputs on profile screen

This commit is contained in:
Vinicius Souza 2024-10-26 15:20:30 -03:00
parent 255f845965
commit 09773ed3e5
2 changed files with 18 additions and 9 deletions

View file

@ -1,27 +1,30 @@
import { Input as GSInput, InputField } from "@gluestack-ui/themed";
import { ComponentProps } from "react";
import { Input as GSInput, InputField } from '@gluestack-ui/themed';
import { ComponentProps } from 'react';
type Props = ComponentProps<typeof InputField>;
type Props = ComponentProps<typeof InputField> & {
isReadOnly?: boolean;
};
export function Input({ ...others }: Props) {
export function Input({ isReadOnly = false, ...others }: Props) {
return (
<GSInput
bg="$gray700"
h="$14"
px="$4"
borderColor="$gray700"
borderWidth="$1"
borderRadius="$md"
$focus={{
borderColor: "$green500"
borderColor: '$green500',
}}
>
isReadOnly={isReadOnly}
opacity={isReadOnly ? 0.5 : 1}>
<InputField
bg="$gray700"
px="$4"
color="$white"
fontFamily="$body"
placeholderTextColor="$gray300"
{...others}
/>
</GSInput>
)
);
}

View file

@ -3,6 +3,7 @@ import { Center, Text, VStack } from '@gluestack-ui/themed';
import { ScreenHeader } from '@components/ScreenHeader';
import { UserPhoto } from '@components/UserPhoto';
import { Input } from '@components/Input';
export function Profile() {
return (
@ -22,6 +23,11 @@ export function Profile() {
Alterar foto
</Text>
</TouchableOpacity>
<Center w="$full" gap="$4">
<Input placeholder="Nome" bg="$gray600" />
<Input value="john.doe@email.com" bg="$gray600" isReadOnly />
</Center>
</Center>
</ScrollView>
</VStack>