Skip to content

Commit 62c4a64

Browse files
committed
Mexendo em alguns icones e detalhes, testando UI/UX e finalizando estilização da pagina de deleção de conta
1 parent 6b19ad0 commit 62c4a64

15 files changed

+64
-49
lines changed

app/(app)/CategorySearchList.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default function CategorySearchList(){
2121
const [modal, setModal] = useState(false)
2222
const [localidade, setLocalidade] = useState(null)
2323
const [estadoDaPeca, setEstadoDaPeca] = useState(null)
24+
const [dataPostagem, setDataPostagem] = useState(null)
2425

2526
const [valor, setValor] = useState(null)
2627

@@ -225,15 +226,14 @@ const subPage = async () => {
225226
<Picker.Item label="Tocantins" value="Tocantins"></Picker.Item>
226227
</Picker>
227228
</View>
229+
<View className="border bg-purple-100 border-black rounded-md w-60 mt-2">
230+
<Picker selectedValue={dataPostagem} onValueChange={(value)=>{setDataPostagem(value)}}>
231+
<Picker.Item label="Selecione uma opção" value={null}></Picker.Item>
232+
<Picker.Item label="Anúncios mais recentes" value="Anúncios mais recentes"></Picker.Item>
233+
<Picker.Item label="Anúncios mais antigos" value="Anúncios mais antigos"></Picker.Item>
234+
</Picker>
235+
</View>
228236
</View>
229-
{/*
230-
<View className="border-2 border-black rounded-lg w-60">
231-
<Picker>
232-
<Picker.Item label="Selecione uma opção" value={null}></Picker.Item>
233-
<Picker.Item label="Postagem recente" value="Postagem Recente"></Picker.Item>
234-
<Picker.Item label="Postagem mais antiga" value="Postagem Mais Antiga"></Picker.Item>
235-
</Picker>
236-
</View> */}
237237
<View className="flex flex-col">
238238
<TouchableOpacity onPress={filter} className="bg-green-500 p-3 rounded-lg w-32 mb-2">
239239
<Text className="text-center">Pesquisar</Text>
@@ -264,12 +264,12 @@ const subPage = async () => {
264264
</View>
265265
{ad.marca == "OUTRA MARCA"
266266
? <View className="flex justify-center ml-2">
267-
<Text className="text-white text-lg mb-2">{ad.categoria}</Text>
267+
<Text className="text-white text-xs font-black mb-2">{ad.categoria}</Text>
268268
<Text className="text-yellow-300">{ad.localidade}</Text>
269269
<Text className="text-white">{formatDate} às {formatHour}</Text>
270270
<Text className="text-yellow-300 mt-4 font-bold">R$ {ad.preco}</Text>
271271
</View> : <View className="flex justify-center ml-2">
272-
<Text className="text-white text-lg mb-2">{ad.categoria} {ad.marca}</Text>
272+
<Text className="text-white text-xs font-black mb-2">{ad.categoria} {ad.marca}</Text>
273273
<Text className="text-yellow-300">{ad.localidade}</Text>
274274
<Text className="text-white">{formatDate} às {formatHour}</Text>
275275
<Text className="text-yellow-300 mt-4 font-bold">R$ {ad.preco}</Text>

app/(app)/ChangeRegisterData.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { View, Text, Linking } from "react-native";
1+
import { View, Text, Linking, Image } from "react-native";
22
import { TextInput, Button, ActivityIndicator, MD2Colors } from "react-native-paper";
33
import { useEffect, useState } from "react";
44
import * as SecureStore from 'expo-secure-store';
@@ -70,7 +70,7 @@ export default function ChangeRegisterData(){
7070
if(novaSenha != confirmarNovaSenha){
7171
alert("As senhas não coincidem!")
7272
} if(nomeNovo == "" || emailNovo == "" || senhaAntiga == "" || novaSenha == "" || confirmarNovaSenha == ""){
73-
alert("Preencha algum campos!")
73+
alert("Preencha algum campo!")
7474
}
7575
else{
7676
if(nomeNovo){
@@ -105,19 +105,20 @@ export default function ChangeRegisterData(){
105105

106106
return(
107107
<View className="pt-12 h-full bg-white flex justify-center items-center">
108+
<Image className="w-28 h-28" source={require("../../public/icons/registerDetailsPng.png")}></Image>
108109
<Text className="mb-4 text-3xl">Alteração de cadastro</Text>
109110
<TextInput label={"Nome atual: " + nome} mode="outlined" className="text-black text-sm w-80 h-10 mb-2" value={nomeNovo} onChangeText={setNomeNovo}></TextInput>
110111
<TextInput label={"Email atual: " + email} mode="outlined" className="text-black text-sm w-80 h-10 mb-2" value={emailNovo} onChangeText={setEmailNovo}></TextInput>
111112
<TextInput label="Senha antiga" mode="outlined" value={senhaAntiga} onChangeText={setSenhaAntiga} className="text-black text-sm w-80 h-10 mb-2"></TextInput>
112113
<TextInput label="Nova senha" mode="outlined" value={novaSenha} onChangeText={setNovaSenha} className="text-black text-sm w-80 h-10 mb-2"></TextInput>
113114
<TextInput label="Confirmar nova senha" mode="outlined" value={confirmarNovaSenha} onChangeText={setConfirmarNovaSenha} className="text-black text-sm w-80 h-10"></TextInput>
114115
<View className="flex gap-2 my-4">
115-
{loading ? <ActivityIndicator animating={true} color={MD2Colors.green500} size={40}/> : <Button onPress={changeRegisterData} mode='contained' className="bg-green-500 w-40">Alterar Dados</Button>}
116+
{loading ? <ActivityIndicator animating={true} color={MD2Colors.green500} size={40}/> : <Button onPress={changeRegisterData} mode='contained' className="bg-green-500 w-60">Alterar Dados</Button>}
116117
<Button onPress={()=>{router.push({
117118
pathname: "/DeleteAccount"
118-
})}} mode='contained' className="bg-red-500 w-40">Excluir conta</Button>
119+
})}} mode='contained' className="bg-red-500 w-60">Desejo excluir minha conta</Button>
119120
</View>
120-
<Text>Em caso de problemas, contate o suporte</Text>
121+
<Text className="text-xs">Em caso de problemas, denúncias ou mais, nos contate!</Text>
121122
<Text className="text-purple-700" onPress={()=>{Linking.openURL("mailto:mercadobmxbr@gmail.com?subject=Suporte")}}>mercadobmxbr@gmail.com</Text>
122123
<BottomBar screen="MenuScreen"></BottomBar>
123124
</View>

app/(app)/DeleteAccount.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState } from "react";
2-
import { View, Text } from "react-native";
2+
import { View, Text, Image } from "react-native";
33
import { Button, TextInput } from "react-native-paper";
44
import BottomBar from "../components/BottomBar";
55
import * as SecureStore from 'expo-secure-store';
@@ -73,19 +73,23 @@ export default function DeleteAccount(){
7373

7474
return(
7575
<View className="h-full bg-white flex justify-center items-center">
76-
<Text>Deseja realmente excluir sua conta?</Text>
77-
<Text>Com isso, excluirá também permanentemente seus anúncios e favoritos.</Text>
76+
<Image className="w-40 h-40" source={require("../../public/icons/sadPng.png")}></Image>
77+
<Text className="text-xl">Deseja realmente excluir sua conta?</Text>
78+
<Text className="text-xs">excluirá também <Text className="text-red-500 font-bold">permanentemente</Text> seus anúncios e favoritos.</Text>
7879
<View className="flex flex-row">
79-
<Button onPress={()=>{setModal(true)}}>Sim</Button>
80-
<Button onPress={()=>{setModal(false)}}>Não</Button>
80+
<Button mode="contained" className="my-4 bg-black w-60" onPress={()=>{setModal(!modal)}}>Sim, desejo continuar.</Button>
8181
</View>
8282
{modal &&
8383
<View>
84-
<Text>Insira o código abaixo e sua senha atual para confirmar</Text>
85-
<Text className="text-purple-700">{randomCode}</Text>
86-
<TextInput value={code} onChangeText={setCode} label="Código" mode="outlined"></TextInput>
87-
<TextInput value={password} onChangeText={setPassword} label="Senha" mode="outlined"></TextInput>
88-
<Button onPress={deleteUser}>Deletar</Button>
84+
<Text>Insira o código abaixo e sua senha atual para confirmar.</Text>
85+
<Text className="text-purple-700 text-center my-2 text-xl">{randomCode}</Text>
86+
<View className="flex items-center mb-4 gap-2">
87+
<TextInput className="w-60" value={code} onChangeText={setCode} label="Código" mode="outlined"></TextInput>
88+
<TextInput className="w-60" value={password} onChangeText={setPassword} label="Senha atual" mode="outlined"></TextInput>
89+
</View>
90+
<View className="flex items-center">
91+
<Button mode="contained" className="w-40 bg-red-500" onPress={deleteUser}>Deletar Conta</Button>
92+
</View>
8993
</View>
9094
}
9195
<BottomBar screen="MenuScreen"></BottomBar>

app/(app)/EditAdScreen/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ export default function EditAdScreen(){
879879
<SpecialAspectsEdit categoria={categoria} onChangeState={updateFilho} data={adData}></SpecialAspectsEdit>
880880
</View>
881881
<View className="flex justify-center items-center mb-8">
882-
<Button mode="contained" className="bg-green-500 w-40" onPress={validateForm}>Anunciar</Button>
882+
<Button mode="contained" className="bg-green-500 w-40" onPress={validateForm}>Editar</Button>
883883
</View>
884884
</View>
885885
)}

app/(app)/EmailChangeVerification.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { router, useLocalSearchParams } from "expo-router";
22
import { useState } from "react";
33
import { Button, TextInput, ActivityIndicator, MD2Colors } from "react-native-paper";
4-
import { View, Text } from "react-native";
4+
import { View, Text, Image } from "react-native";
55
import axiosInstance from "../server/axios";
66
import * as SecureStore from 'expo-secure-store';
77
import { useSession } from "../../auth/ctx";
@@ -52,10 +52,10 @@ export default function EmailChangeVerification(){
5252
alert("Conta ativada com sucesso!")
5353
signOut()
5454
} else {
55-
alert("Erro ao validar conta!")
55+
alert("Erro ao validar e-mail!")
5656
}
5757
}).catch((error) => {
58-
alert("Erro ao validar conta!")
58+
alert("Erro ao validar e-mail!")
5959
})
6060
} catch(error){
6161
alert("Erro ao validar conta!")
@@ -69,11 +69,12 @@ export default function EmailChangeVerification(){
6969

7070
return(
7171
<View className="h-full bg-white flex justify-center items-center">
72+
<Image className="w-20 h-20" source={require("../../public/icons/emailSendPng.png")}></Image>
7273
<Text>Verifique seu email: <Text className="text-purple-700">{newEmail}</Text></Text>
7374
<Text className="mt-2">Insira o <Text className="text-green-500">código</Text> recebido abaixo</Text>
7475
<TextInput className="w-60 my-4" maxLength={6} label="Código" mode="outlined" value={code} onChangeText={setCode} />
75-
{loading ? <ActivityIndicator animating={true} color={MD2Colors.green500} size={40}/> : <Button mode='contained' className="bg-green-500 w-40" onPress={sendEmailCode}>Enviar código</Button>}
76-
{loading2 ? <ActivityIndicator className="mt-2" animating={true} color={MD2Colors.purpleA700} size={40}/> : <Button mode='contained' className="bg-purple-500 w-40 mt-2" onPress={activateAccount}>Ativar conta</Button>}
76+
{loading ? <ActivityIndicator animating={true} color={MD2Colors.green500} size={40}/> : <Button mode='contained' className="bg-green-500 w-60" onPress={sendEmailCode}>Enviar código</Button>}
77+
{loading2 ? <ActivityIndicator className="mt-2" animating={true} color={MD2Colors.purpleA700} size={40}/> : <Button mode='contained' className="bg-purple-500 w-60 mt-2" onPress={activateAccount}>Verificar novo email!</Button>}
7778
<BottomBar screen="MenuScreen"></BottomBar>
7879
</View>
7980
)

app/(app)/FormAdScreen.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { View, Text, TouchableOpacity, Image, ScrollView } from "react-native";
2-
import { TextInput, Button } from "react-native-paper";
2+
import { TextInput, Button, ActivityIndicator, MD2Colors } from "react-native-paper";
33
import BottomBar from "../components/BottomBar";
44
import SpecialAspects from "../components/SpecialAspects";
55
import React, {useEffect, useState} from "react";
@@ -10,6 +10,8 @@ import { router } from "expo-router";
1010
import * as SecureStore from 'expo-secure-store';
1111

1212
export default function FormAdScreen(){
13+
14+
const [loading, setLoading] = useState(false);
1315

1416
const [abracadeiraDiametro, setAbracadeiraDiametro] = useState(null)
1517
const [aroTipoFolha, setAroTipoFolha] = useState(null)
@@ -492,6 +494,7 @@ export default function FormAdScreen(){
492494
idUsuario: idUsuario,
493495
imagem: uploadImagem
494496
};
497+
setLoading(true);
495498
try {
496499
const token = await SecureStore.getItemAsync('session');
497500
const formData = new FormData();
@@ -526,6 +529,8 @@ export default function FormAdScreen(){
526529

527530
} catch (error) {
528531
alert("Erro ao enviar imagem, tente novamente");
532+
} finally{
533+
setLoading(false);
529534
}
530535
}
531536
}
@@ -739,7 +744,7 @@ export default function FormAdScreen(){
739744
<SpecialAspects categoria={categoria} onChangeState={updateFilho}></SpecialAspects>
740745
</View>
741746
<View className="flex justify-center items-center mb-8">
742-
<Button mode="contained" className="bg-green-500 w-40" onPress={validateForm}>Anunciar</Button>
747+
{loading ? <ActivityIndicator animating={true} color={MD2Colors.green500} size={40}/> : <Button mode="contained" className="bg-green-500 w-40" onPress={validateForm}>Anunciar</Button>}
743748
</View>
744749
</View>
745750
)}

app/(app)/FullAdScreen/[id].tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ export default function FullAdScreen(){
141141
<Text className="mb-1">Estado da peça: {adData.estadoDaPeca}</Text>
142142
<Text className="mb-1">Cor: {adData.cor}</Text>
143143
<Text className="mb-1">Material: {adData.material}</Text>
144-
<Text className="mb-1">Peso aproximado: {adData.peso}</Text>
145-
<Text className="mb-1">Descrição: {adData.descricao}</Text>
144+
<Text className="mb-3">Peso aproximado: {adData.peso}</Text>
145+
<Text className="mb-1"><Text className="text-purple-700">Descrição</Text> -------------------------------------------------------------------------</Text>
146+
<Text>{adData.descricao}</Text>
146147
</View>
147148
<View className="mt-4 bg-gray-200 rounded-lg p-2">
148149
<Text className="mb-4 text-purple-700">Características Específicas</Text>

app/(app)/MyAds.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export default function MyAds(){
8484
<View className="flex h-full bg-white">
8585
{loading && <ActivityIndicator className="absolute top-0 left-0 right-0 bottom-0" animating={true} color={MD2Colors.purpleA700} size={50}></ActivityIndicator>}
8686
<View className="mt-12">
87-
<Text className="text-3xl m-1">Meus anúncios</Text>
87+
<View className="flex flex-row items-center">
88+
<Text className="text-3xl m-1">Meus anúncios</Text>
89+
<Image className="w-8 h-8" source={require("../../public/icons/tagAdsPng.png")}></Image>
90+
</View>
8891
{ads.length == 0 && <Text className="text-center text-2xl mt-20">Você ainda não possui anúncios cadastrados!</Text>}
8992
<ScrollView className="mb-28" showsVerticalScrollIndicator={false}>
9093
<View>
@@ -100,23 +103,23 @@ export default function MyAds(){
100103
}}>
101104
<View className="bg-purple-700 m-1 p-2 flex flex-row justify-between items-center rounded-lg">
102105
<View className="flex flex-row">
103-
<View>
106+
<View className="flex justify-center">
104107
<Image style={{resizeMode:"cover"}} source={{uri:ad.imagem}} className="w-24 h-24 rounded-lg"></Image>
105108
</View>
106109
{ad.marca == "OUTRA MARCA"
107110
? <View className="flex justify-center ml-2">
108-
<Text className="text-white text-lg mb-2">{ad.categoria}</Text>
109-
<Text className="text-yellow-300 font-bold mb-2">Preço: R${ad.preco}</Text>
110-
<Text className="text-white">Postagem: {formatDate}</Text>
111+
<Text className="text-white text-xs font-black mb-2">{ad.categoria}</Text>
112+
<Text className="text-yellow-300 font-bold mb-2">R$ {ad.preco}</Text>
113+
<Text className="text-white">{formatDate}</Text>
111114
<Text className="text-white">Whatsapp: {ad.whatsapp}</Text>
112115
</View> : <View className="flex justify-center ml-2">
113-
<Text className="text-white text-lg mb-2">{ad.categoria} {ad.marca}</Text>
116+
<Text className="text-white text-xs font-black mb-2">{ad.categoria} {ad.marca}</Text>
114117
<Text className="text-yellow-300 font-bold mb-2">R$ {ad.preco}</Text>
115-
<Text className="text-white">Postagem: {formatDate}</Text>
118+
<Text className="text-white">{formatDate}</Text>
116119
<Text className="text-white">Whatsapp: {ad.whatsapp}</Text>
117120
</View>}
118121
</View>
119-
<View>
122+
<View className="flex gap-4">
120123
<TouchableOpacity onPress={()=>deleteAd(ad.id)}><Image className="w-10 h-10" source={require('../../public/icons/deletePng.png')}></Image></TouchableOpacity>
121124
<TouchableOpacity onPress={()=>{router.push({
122125
pathname: "/EditAdScreen/[id]",

app/(app)/MyFavorites.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default function MyFavorites(){
8888
})
8989
}}>
9090
<FavoriteAd id={favorite.idAnuncio}></FavoriteAd>
91-
<View className="absolute right-2 top-20">
91+
<View className="absolute right-4 top-16">
9292
<TouchableOpacity onPress={()=>removeFavorite(favorite.idAnuncio)}><Image className="w-10 h-10" source={require('../../public/icons/deletePng.png')}></Image></TouchableOpacity>
9393
</View>
9494
</TouchableOpacity>

0 commit comments

Comments
 (0)