From 4de312e8252268841b5b78937a568a064a6d88f9 Mon Sep 17 00:00:00 2001 From: William Moraes Date: Tue, 14 May 2024 19:45:49 -0300 Subject: [PATCH 1/2] feat: :sparkles: improve address input sort --- src/app/shelter/page.tsx | 159 +++++++++++++++++++++------------------ 1 file changed, 84 insertions(+), 75 deletions(-) diff --git a/src/app/shelter/page.tsx b/src/app/shelter/page.tsx index 4975300..b606ae0 100644 --- a/src/app/shelter/page.tsx +++ b/src/app/shelter/page.tsx @@ -223,57 +223,92 @@ function Shelter() {

Endereço

+
+
+ ( + + CEP + + { + field.onChange(cepMask(e.target.value)); + }} + onBlur={() => { + if (fieldState.invalid) return; + fetch( + `https://viacep.com.br/ws/${field.value}/json/`, + ) + .then((response) => response.json()) + .then(populateAddressWithViaCepData) + .catch((error) => { + console.log(error); + }); + }} + /> + + + + )} + /> +
+
+ ( + + Logradouro + + + + + + )} + /> +
+
+
+ ( + + Bairro + + + + + + )} + /> + + ( + + Número + + + + + + )} + /> +
( - - CEP - - { - field.onChange(cepMask(e.target.value)); - }} - onBlur={() => { - if (fieldState.invalid) return; - fetch( - `https://viacep.com.br/ws/${field.value}/json/`, - ) - .then((response) => response.json()) - .then(populateAddressWithViaCepData) - .catch((error) => { - console.log(error); - }); - }} - /> - - - - )} - /> - ( - - Rua - - - - - - )} - /> - ( - Bairro + Complemento (opcional) - + @@ -282,12 +317,12 @@ function Shelter() {
( - Número + Cidade - + @@ -315,32 +350,6 @@ function Shelter() { )} />
- ( - - Cidade - - - - - - )} - /> - ( - - Complemento (opcional) - - - - - - )} - />
From b05796af522bacaa1af7fd01970cbcab7d60b4c9 Mon Sep 17 00:00:00 2001 From: William Moraes Date: Tue, 14 May 2024 20:09:43 -0300 Subject: [PATCH 2/2] fix: :bug: adjust mobile address form --- src/app/shelter/page.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/shelter/page.tsx b/src/app/shelter/page.tsx index b606ae0..47d1034 100644 --- a/src/app/shelter/page.tsx +++ b/src/app/shelter/page.tsx @@ -223,8 +223,8 @@ function Shelter() {

Endereço

-
-
+
+
-
+
-
+
)} /> -
+