Skip to content

Commit 4e0d9c0

Browse files
filipepachecohelenapaixaofagundesjgluccas-spechtMatheusDubin
authored
Release 0.0.1 (#135)
* [fix] Config readme * wip: loading * Delete yarn.lock * refact: created shelter list view component in home page * Fix: mobile UI has broken for mobile devices (#22) *Fix: mobile UI has broken for mobile devices * fix: remove chip as fixed as no wrap property * chore: add shelter card clickable * chore: remove Fragment component * build: add set sm as max mobile dimension sm: 425px * style: add responsive layout * refactor: filter page * fix: priority * fix: filter parameters * fix: fixed volunteer supply that had been fulfilled displaying on shelter page * fix: improve readability * feat: hidden filter button if filter is empty * feat: cache in axios request * fix: cache search params * feat: cache clean on searchs * wip: donation tags * fix: clean search params * Update README.md [fix] Retirando a seção Funcionalidades e Backlog * fix: donation tags / componentized the urgent supplies section * fix: removed empty shelter tags empty row * feat: full edit shelter and improved interface of pet friendly in shelter page * refact: add live link and tech stack to readme * Fix/develop bugs (#90) * fix: cache bug (invalite cache on create/update operation) * feat: added update many shelter supplies and admin rule * Add license (#81) Closes #65. * fix: app port (#80) * docs: added shadcn/ui reference * fix for volunteer shelter title (#95) * treat contact link as a proper link * simplified href * docs: add discord link on readme * Normalizes search string in supply filter so it ignores accents (#125) * normalized search string to ignore accents * revert removed button * add a copy to clipboard button to PIX and contact info (#124) * add a copy to clipboard button to PIX and contact info * use && operator instead of ternary * Substitui onClick e useNavigate por <Link> para melhorar acessibilidade (#128) * replaced navigate in favour of html link and added card hover * fixed lint warnings * fix: change shelter title style (#106) Prevents badge misalignment on very large titles * Add new feature and creating LoadingSkeleton (#115) * Add new feature and creating LoadingSkeleton --------- Co-authored-by: helenapaixao <[email protected]> Co-authored-by: José Fagundes <[email protected]> Co-authored-by: Luccas Specht <[email protected]> Co-authored-by: MatheusDubin <[email protected]> Co-authored-by: danmqs <[email protected]> Co-authored-by: Giovanni Bassi <[email protected]> Co-authored-by: Felipe Monteiro <[email protected]> Co-authored-by: André Ferraz <[email protected]> Co-authored-by: Sombrio <[email protected]> Co-authored-by: Daniel Marques <[email protected]> Co-authored-by: Matheus Dubin Da Silveira <[email protected]> Co-authored-by: Miguel Dalberto <[email protected]> Co-authored-by: Pablo A. Maximo <[email protected]> Co-authored-by: Marcos Nascimento <[email protected]>
1 parent 3d3f437 commit 4e0d9c0

File tree

11 files changed

+133
-82
lines changed

11 files changed

+133
-82
lines changed

README.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Este projeto é o frontend de um aplicativo destinado a auxiliar na organização e distribuição de suprimentos, além de coordenar voluntários durante os alagamentos no Rio Grande do Sul. A aplicação visa conectar pessoas afetadas pelas enchentes com recursos essenciais e voluntários dispostos a ajudar.
44

5+
## Acesso à Aplicação
6+
7+
[SOS Rio Grande do Sul](https://sos-rs.com/)
8+
[Discord](https://discord.gg/eJTuannsd6)
9+
510
## Sobre o Projeto
611

712
O objetivo deste aplicativo é facilitar uma resposta rápida e eficiente em situações de emergência causadas por enchentes, promovendo a colaboração e o apoio mútuo entre a comunidade e organizações de ajuda.
@@ -10,32 +15,20 @@ O objetivo deste aplicativo é facilitar uma resposta rápida e eficiente em sit
1015

1116
Este frontend foi desenvolvido utilizando as seguintes tecnologias:
1217

13-
- **React**: Uma biblioteca JavaScript para construir interfaces de usuário.
14-
15-
## Funcionalidades e Backlog
16-
17-
O app inclui as seguintes funcionalidades:
18-
19-
- [x] **Cadastro de Itens de suprimentos**: Permite que voluntários se inscrevam para ajudar.
20-
- [x] **Busca de abrigos**: Gerencia a logística de distribuição de suprimentos para as áreas mais necessitadas.
21-
- [x] **Alteração de necessidades de abrigos**: Exibe um mapa das áreas afetadas e pontos de coleta de suprimentos.
22-
- [ ] **Cadastro de abrigos**: Criar tela para cadastro de abrigos (Nome, endereço, capacidade, vagas, aceita pets) e colocar pendende de aprovação.
23-
- [ ] **Alteração de abrigos**: Pemitir alterar quantidade de vagas disponívies, se aceita pet ou endereço.
24-
- [ ] **Cadastro de usuários**: Criar tela de cadastro (nome, telefone, senha) e login.
25-
- [ ] **Filtro por item e por cidade**: Opção de filtrar abrigos por cidade ou que precisam de algum item específico.
26-
- [ ] **Alterar ordenação**: Trocar a ordenação atual para ordenação por última atualização.
27-
- [ ] **Adicionar mapa de abrigos**: Criar uma tela com um mapa e todos os abrigos. Verificar a posibilidade de usar geolocation para mostrar a posição do usuário no mapa.
28-
18+
- [**React**](https://react.dev/): Uma biblioteca JavaScript para construir interfaces de usuário.
19+
- [**Vite**](https://vitejs.dev/guide/): Uma ferramenta de build com servidor de desenvolvimento.
20+
- [**Tailwind CSS**](https://tailwindcss.com/docs/installation): Framework CSS baseado em classes utilitárias.
21+
- [**shadcn/ui**](https://ui.shadcn.com/docs): Coleção de componentes reutilizáveis, baseado em Tailwind.
2922

3023
Para executar o frontend do aplicativo em seu ambiente local, siga os passos abaixo:
3124

3225
1. Clone o repositório:
3326
```
34-
git clone https://github.com/seuusuario/projeto-enchentes-frontend.git
27+
git clone https://github.com/SOS-RS/frontend
3528
```
3629
2. Entre no diretório do projeto:
3730
```
38-
cd projeto-enchentes-frontend
31+
cd frontend
3932
```
4033
3. Instale as dependências:
4134
```
@@ -53,7 +46,7 @@ Contribuições são muito bem-vindas! Se você tem interesse em ajudar a melhor
5346

5447
1. Faça um fork do repositório.
5548
2. Crie uma branch para sua feature (`git checkout -b feature/MinhaFeature`).
56-
3. Faça seus commits (`git commit -am 'Adicionando uma nova feature'`).
49+
3. Faça seus commits (`git commit -m 'Adicionando uma nova feature'`).
5750
4. Faça push para a branch (`git push origin feature/MinhaFeature`).
5851
5. Abra um Pull Request.
5952

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
2828
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
2929
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
30+
<link rel="icon" type="image/x-icon" href="/favicon.ico">
3031
<link rel="manifest" href="/site.webmanifest">
32+
<link rel="canonical" href="https://sos-rs.com/" />
3133

3234
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" />
3335
<title>SOS - Rio Grande do Sul</title>

src/components/CardAboutShelter/CardAboutShelter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ const CardAboutShelter = (props: ICardAboutShelter) => {
6565
value={
6666
check(shelter.contact) ? `${shelter.contact}` : 'Não informado'
6767
}
68+
clipboardButton={check(shelter.contact)}
6869
/>
6970
<InfoRow
7071
icon={<Landmark />}
7172
label="Chave Pix:"
7273
value={check(shelter.pix) ? `${shelter.pix}` : 'Não informado'}
74+
clipboardButton={check(shelter.pix)}
7375
/>
7476
</div>
7577
</Card>

src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import { IInfoRowProps } from './types';
44

55
const InfoRow = React.forwardRef<HTMLDivElement, IInfoRowProps>(
66
(props, ref) => {
7-
const { icon, label, value, className = '', ...rest } = props;
7+
const { icon, label, value, clipboardButton = false, className = '', ...rest } = props;
88
const isLink = value?.startsWith('http');
99
const ValueComp = !value ? (
1010
<Fragment />
1111
) : isLink ? (
12-
<a
12+
<a href={value} target='_blank'
1313
className="text-blue-500 break-all cursor-pointer hover:underline"
14-
onClick={() => window.open(value, '_blank')}
1514
>
1615
{value}
1716
</a>
@@ -36,7 +35,18 @@ const InfoRow = React.forwardRef<HTMLDivElement, IInfoRowProps>(
3635
<span className={cn('font-normal', value ? 'text-nowrap' : '')}>
3736
{label}
3837
</span>
39-
<span className="md:flex">{ValueComp}</span>
38+
<span className="md:flex">
39+
{ValueComp}
40+
{clipboardButton && value && (
41+
<div
42+
className="text-blue-600 mx-2 hover:cursor-pointer active:text-blue-800"
43+
onClick={() => navigator.clipboard.writeText(value)}
44+
>
45+
copiar
46+
</div>
47+
)}
48+
</span>
49+
4050
</div>
4151
</div>
4252
);

src/components/CardAboutShelter/components/InfoRow/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export interface IInfoRowProps extends React.ComponentPropsWithoutRef<'div'> {
22
label: React.ReactNode;
33
value?: string;
44
icon: React.ReactNode;
5+
clipboardButton?: boolean;
56
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
type LoadingSkeletonProps = {
2+
amountItems: number
3+
}
4+
5+
const LoadingSkeleton = ({ amountItems }: LoadingSkeletonProps) => {
6+
return (
7+
<div className="w-full">
8+
<ul className="grid grid-cols-1 gap-5 mt-4">
9+
{Array.from({length: amountItems,}).map((_, index) => (
10+
<li key={index} className="p-4 w-full border-2 border-border rounded-md space-y-3">
11+
<div className="flex justify-between items-center space-x-2">
12+
<div className="animate-pulse h-10 bg-[#ccc] rounded-md w-full max-w-sm" />
13+
<div className="animate-pulse h-10 bg-[#ccc] rounded-md w-10" />
14+
</div>
15+
16+
<div className="animate-pulse h-10 bg-[#ccc] rounded-md w-full max-w-xs" />
17+
18+
<div className="border-b border-[#ccc] opacity-25"/>
19+
20+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 md:grid-cols-4 gap-4 mt-5">
21+
{Array.from({length: 7}).map((_, index) => (
22+
<div
23+
key={index}
24+
className="animate-pulse h-8 bg-[#ccc] rounded-full w-full"
25+
/>
26+
))}
27+
</div>
28+
29+
<div className="border-b border-[#ccc] opacity-25"/>
30+
31+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 md:grid-cols-4 gap-4 mt-5">
32+
{Array.from({length: 7}).map((_, index) => (
33+
<div
34+
key={index}
35+
className="animate-pulse h-8 bg-[#ccc] rounded-full w-full"
36+
/>
37+
))}
38+
</div>
39+
</li>
40+
))}
41+
</ul>
42+
</div>
43+
)
44+
}
45+
46+
export { LoadingSkeleton }
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { LoadingSkeleton } from "./LoadingSkeleton";
2+
3+
export { LoadingSkeleton }

src/pages/EditShelterSupply/EditShelterSupply.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const EditShelterSupply = () => {
3030
if (v) {
3131
setFilteredSupplies(
3232
supplies.filter((s) =>
33-
s.name.toLowerCase().includes(v.toLowerCase())
33+
s.name.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '')
34+
.includes(v.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ''))
3435
)
3536
);
3637
} else setFilteredSupplies(supplies);

src/pages/Home/Home.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useCallback, useContext, useMemo, useState } from 'react';
2-
import { useNavigate, useSearchParams } from 'react-router-dom';
2+
import { useSearchParams } from 'react-router-dom';
33
import { RotateCw, LogOutIcon, PlusIcon } from 'lucide-react';
44
import qs from 'qs';
55

@@ -48,7 +48,6 @@ const Home = () => {
4848
},
4949
[]
5050
);
51-
const navigate = useNavigate();
5251

5352
const clearSearch = useCallback(() => {
5453
setSearch('');
@@ -161,7 +160,6 @@ const Home = () => {
161160
setFilterData((prev) => ({ ...prev, search: v }));
162161
setSearch(v);
163162
}}
164-
onSelectShelter={(s) => navigate(`/abrigo/${s.id}`)}
165163
hasMoreItems={hasMore}
166164
onOpenModal={() => setOpenModal(true)}
167165
onClearSearch={clearSearch}

src/pages/Home/components/ShelterListItem/ShelterListItem.tsx

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useCallback, useMemo } from 'react';
22
import { format } from 'date-fns';
3-
import { useNavigate } from 'react-router-dom';
3+
import { Link } from 'react-router-dom';
44
import { ChevronRight } from 'lucide-react';
55

66
import {
@@ -20,9 +20,8 @@ import { IUseSheltersDataSupplyData } from '@/hooks/useShelters/types';
2020
import { ShelterSupplyCategoryRow } from '../ShelterSupplyCategoryRow';
2121

2222
const ShelterListItem = (props: IShelterListItemProps) => {
23-
const { data, onClick } = props;
23+
const { data } = props;
2424
const { capacity, shelteredPeople } = data;
25-
const navigate = useNavigate();
2625
const { availability, className: availabilityClassName } =
2726
useMemo<IShelterAvailabilityProps>(
2827
() => getAvailabilityProps(capacity, shelteredPeople),
@@ -42,53 +41,52 @@ const ShelterListItem = (props: IShelterListItemProps) => {
4241
}, []);
4342

4443
return (
45-
<div className="flex flex-col p-4 w-full border-2 border-border rounded-md gap-1 relative">
46-
<Button size="sm" variant="ghost" className="absolute top-4 right-4">
47-
<ChevronRight
48-
className="h-5 w-5"
49-
onClick={() => navigate(`/abrigo/${data.id}`)}
50-
/>
51-
</Button>
52-
<div
53-
className="flex items-center gap-1"
54-
onClick={() => navigate(`/abrigo/${data.id}`)}
55-
>
56-
<h3
57-
className="font-semibold text-lg hover:cursor-pointer hover:text-slate-500"
58-
onClick={onClick}
59-
>
60-
{data.name}
61-
</h3>
62-
{data.verified && <VerifiedBadge />}
44+
<Link to={`/abrigo/${data.id}`} target="_blank">
45+
<div className="flex flex-col p-4 w-full border-2 border-border rounded-md gap-1 relative hover:bg-accent">
46+
<div className="inline-flex justify-between">
47+
<div className="flex flex-row items-center gap-1">
48+
<h3 className="font-semibold text-lg h-full hover:cursor-pointer hover:text-slate-500">
49+
{data.name}
50+
</h3>
51+
{data.verified && (
52+
<div className="h-full pt-1">
53+
<VerifiedBadge />
54+
</div>
55+
)}
56+
</div>
57+
<Button size="sm" variant="ghost">
58+
<ChevronRight className="h-5 w-5" />
59+
</Button>
60+
</div>
61+
<h6 className={cn('font-semibold text-md', availabilityClassName)}>
62+
{availability}
63+
</h6>
64+
<h6 className="text-muted-foreground text-sm md:text-lg font-medium">
65+
{data.address}
66+
</h6>
67+
{data.shelterSupplies.length > 0 && (
68+
<>
69+
<ShelterSupplyCategoryRow
70+
title="Necessita voluntários:"
71+
tags={tags.NeedVolunteers.map(getChipProps)}
72+
/>
73+
<ShelterSupplyCategoryRow
74+
title="Necessita urgente doações de:"
75+
tags={tags.NeedDonations.map(getChipProps)}
76+
/>
77+
<ShelterSupplyCategoryRow
78+
title="Sobrando para doações:"
79+
tags={tags.RemainingSupplies.map(getChipProps)}
80+
/>
81+
</>
82+
)}
83+
{data.updatedAt && (
84+
<small className="text-sm md:text-md font-light text-muted-foreground mt-2">
85+
Atualizado em {format(data.updatedAt, 'dd/MM/yyyy HH:mm')}
86+
</small>
87+
)}
6388
</div>
64-
<h6 className={cn('font-semibold text-md', availabilityClassName)}>
65-
{availability}
66-
</h6>
67-
<h6 className="text-muted-foreground text-sm md:text-lg font-medium">
68-
{data.address}
69-
</h6>
70-
{data.shelterSupplies.length > 0 && (
71-
<>
72-
<ShelterSupplyCategoryRow
73-
title="Necessita volunários:"
74-
tags={tags.NeedVolunteers.map(getChipProps)}
75-
/>
76-
<ShelterSupplyCategoryRow
77-
title="Necessita urgente doações de:"
78-
tags={tags.NeedDonations.map(getChipProps)}
79-
/>
80-
<ShelterSupplyCategoryRow
81-
title="Sobrando para doações:"
82-
tags={tags.RemainingSupplies.map(getChipProps)}
83-
/>
84-
</>
85-
)}
86-
{data.updatedAt && (
87-
<small className="text-sm md:text-md font-light text-muted-foreground mt-2">
88-
Atualizado em {format(data.updatedAt, 'dd/MM/yyyy HH:mm')}
89-
</small>
90-
)}
91-
</div>
89+
</Link>
9290
);
9391
};
9492

0 commit comments

Comments
 (0)