From 27dc867cc0b0377ee1ec76546dbf6e4844f26ef8 Mon Sep 17 00:00:00 2001 From: Sombrio Date: Sat, 11 May 2024 16:58:57 -0300 Subject: [PATCH 1/8] modified InfoRow component to accept children --- .../CardAboutShelter/components/InfoRow/InfoRow.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx b/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx index 733c3ce4..00a36758 100644 --- a/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx +++ b/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx @@ -4,7 +4,7 @@ import { IInfoRowProps } from './types'; const InfoRow = React.forwardRef( (props, ref) => { - const { icon, label, value, className = '', ...rest } = props; + const { icon, label, value, className = '', children, ...rest } = props; const isLink = value?.startsWith('http'); const ValueComp = !value ? ( @@ -37,6 +37,11 @@ const InfoRow = React.forwardRef( {label} {ValueComp} + {children ? ( + children + ) : ( + null + )} ); From 463c48cabb363aa0110edff1b9348ad56e58ed01 Mon Sep 17 00:00:00 2001 From: Sombrio Date: Sat, 11 May 2024 16:59:31 -0300 Subject: [PATCH 2/8] Added Google Maps link right next to address in InfoRow --- src/api/api.ts | 2 +- src/components/CardAboutShelter/CardAboutShelter.tsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index 3c975711..b2647d0a 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -2,7 +2,7 @@ import axios, { AxiosRequestHeaders, InternalAxiosRequestConfig } from 'axios'; import { clearCache, getCacheRequestData, handleCacheResponse } from './cache'; const api = axios.create({ - baseURL: import.meta.env.VITE_API_URL ?? 'http://localhost:4000/', + baseURL: import.meta.env.VITE_API_URL ?? 'https://api.sos-rs.com/', }); function handleRequestAuthToken(config: InternalAxiosRequestConfig) { diff --git a/src/components/CardAboutShelter/CardAboutShelter.tsx b/src/components/CardAboutShelter/CardAboutShelter.tsx index 91766106..3f1390d1 100644 --- a/src/components/CardAboutShelter/CardAboutShelter.tsx +++ b/src/components/CardAboutShelter/CardAboutShelter.tsx @@ -22,7 +22,15 @@ const CardAboutShelter = (props: ICardAboutShelter) => {
Sobre o abrigo
- } label={shelter.address} /> + } label={`${shelter.address}`}> + + Abrir no Google Maps + + } label={ @@ -72,7 +80,7 @@ const CardAboutShelter = (props: ICardAboutShelter) => { value={check(shelter.pix) ? `${shelter.pix}` : 'Não informado'} />
-
+ ); }; From f350126e25009850392a161f6834ff962ce5ec50 Mon Sep 17 00:00:00 2001 From: Sombrio Date: Sat, 11 May 2024 17:00:24 -0300 Subject: [PATCH 3/8] rollback change --- src/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/api.ts b/src/api/api.ts index b2647d0a..3c975711 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -2,7 +2,7 @@ import axios, { AxiosRequestHeaders, InternalAxiosRequestConfig } from 'axios'; import { clearCache, getCacheRequestData, handleCacheResponse } from './cache'; const api = axios.create({ - baseURL: import.meta.env.VITE_API_URL ?? 'https://api.sos-rs.com/', + baseURL: import.meta.env.VITE_API_URL ?? 'http://localhost:4000/', }); function handleRequestAuthToken(config: InternalAxiosRequestConfig) { From 9321acb095ebfe2195d9a1dc2c46bd54cb21b99c Mon Sep 17 00:00:00 2001 From: Sombrio Date: Sat, 11 May 2024 17:16:15 -0300 Subject: [PATCH 4/8] changed text --- src/components/CardAboutShelter/CardAboutShelter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CardAboutShelter/CardAboutShelter.tsx b/src/components/CardAboutShelter/CardAboutShelter.tsx index 3f1390d1..2ff684d4 100644 --- a/src/components/CardAboutShelter/CardAboutShelter.tsx +++ b/src/components/CardAboutShelter/CardAboutShelter.tsx @@ -28,7 +28,7 @@ const CardAboutShelter = (props: ICardAboutShelter) => { target="_blank" className="text-blue-500 break-all cursor-pointer hover:underline" > - Abrir no Google Maps + Ver no Google Maps Date: Sat, 11 May 2024 17:17:43 -0300 Subject: [PATCH 5/8] simplified children render --- .../CardAboutShelter/components/InfoRow/InfoRow.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx b/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx index 00a36758..22e2dadd 100644 --- a/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx +++ b/src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx @@ -37,11 +37,7 @@ const InfoRow = React.forwardRef( {label} {ValueComp} - {children ? ( - children - ) : ( - null - )} + {children} ); From 42e14acf7a3faa95780415dad3d7d7a362fda7b6 Mon Sep 17 00:00:00 2001 From: Sombrio Date: Sat, 11 May 2024 17:19:04 -0300 Subject: [PATCH 6/8] Update src/components/CardAboutShelter/CardAboutShelter.tsx Co-authored-by: Henrique Campos de Freitas --- src/components/CardAboutShelter/CardAboutShelter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CardAboutShelter/CardAboutShelter.tsx b/src/components/CardAboutShelter/CardAboutShelter.tsx index 2ff684d4..4aefa762 100644 --- a/src/components/CardAboutShelter/CardAboutShelter.tsx +++ b/src/components/CardAboutShelter/CardAboutShelter.tsx @@ -80,7 +80,7 @@ const CardAboutShelter = (props: ICardAboutShelter) => { value={check(shelter.pix) ? `${shelter.pix}` : 'Não informado'} /> - + ); }; From 9754645224e60aa13c250de6262b097fba47705c Mon Sep 17 00:00:00 2001 From: Sombrio Date: Sat, 11 May 2024 17:21:13 -0300 Subject: [PATCH 7/8] removed useless css class --- src/components/CardAboutShelter/CardAboutShelter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CardAboutShelter/CardAboutShelter.tsx b/src/components/CardAboutShelter/CardAboutShelter.tsx index 4aefa762..1503668e 100644 --- a/src/components/CardAboutShelter/CardAboutShelter.tsx +++ b/src/components/CardAboutShelter/CardAboutShelter.tsx @@ -22,7 +22,7 @@ const CardAboutShelter = (props: ICardAboutShelter) => {
Sobre o abrigo