Skip to content

Commit 3e749ee

Browse files
authored
Merge pull request #42 from SOS-RS/develop
develop into master
2 parents 06975e4 + 646f11b commit 3e749ee

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

src/components/Header/Header.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ const Header = React.forwardRef<HTMLDivElement, IHeader>((props, ref) => {
2424
{startAdornment}
2525
<h3 className="font-medium text-white">{title}</h3>
2626
</div>
27-
<div className="cursor-pointer ">{endAdornment}</div>
27+
<div className="flex items-center">
28+
<a
29+
href="https://forms.gle/2S7L2gR529Dc8P3T9"
30+
className="bg-white hover:bg-rose-50 text-red-600 font-medium text-xs md:text-base py-2 px-1 md:py-2 md:px-4 rounded-full"
31+
target="_blank"
32+
>
33+
Cadastrar abrigo
34+
</a>
35+
<div className="cursor-pointer ">{endAdornment}</div>
36+
</div>
2837
</div>
2938
);
3039
});

src/components/ShelterListItem/ShelterListItem.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Separator } from '../ui/separator';
99
import { Chip } from '../Chip';
1010
import { Button } from '../ui/button';
1111
import { VerifiedBadge } from '@/components/VerifiedBadge/VerifiedBadge.tsx';
12+
import { SupplyPriority } from '@/service/supply/types';
1213

1314
const ShelterListItem = (props: IShelterListItemProps) => {
1415
const { data } = props;
@@ -22,7 +23,7 @@ const ShelterListItem = (props: IShelterListItemProps) => {
2223

2324
const tags = useMemo(
2425
() => {
25-
return data.shelterSupplies?.filter((s) => !getCategoriesToFilterVolunteers().some(c => c.includes(s.supply?.supplyCategory?.name.toLowerCase())))
26+
return data.shelterSupplies?.filter((s) => !getCategoriesToFilterVolunteers().some(c => c.includes(s.supply?.supplyCategory?.name.toLowerCase())) && !(s.priority === SupplyPriority.Remaining))
2627
.sort((a, b) => b.priority - a.priority).slice(0, 10)
2728
},
2829
[data.shelterSupplies]
@@ -35,6 +36,14 @@ const ShelterListItem = (props: IShelterListItemProps) => {
3536
[data.shelterSupplies]
3637
)
3738

39+
const donationsTags = useMemo(
40+
() => {
41+
return data.shelterSupplies?.filter((s) => !getCategoriesToFilterVolunteers().some(c => c.includes(s.supply?.supplyCategory?.name.toLowerCase())) && s.priority === SupplyPriority.Remaining).reverse()
42+
},
43+
[data.shelterSupplies]
44+
)
45+
46+
3847
return (
3948
<div className="flex flex-col p-4 w-full border-2 border-border rounded-md gap-1 relative">
4049
<Button
@@ -97,6 +106,22 @@ const ShelterListItem = (props: IShelterListItemProps) => {
97106
))}
98107
</div>
99108
</div>
109+
<div className="flex flex-col gap-3">
110+
<Separator className="mt-2" />
111+
<p className="text-muted-foreground text-sm md:text-lg font-medium">
112+
Sobrando, para doações:
113+
</p>
114+
<div className="flex gap-2 flex-wrap">
115+
{donationsTags.map((s, idx) => (
116+
<Chip
117+
className={getSupplyPriorityProps(s.priority).className}
118+
key={idx}
119+
label={s.supply.name}
120+
/>
121+
))}
122+
</div>
123+
124+
</div>
100125
</>
101126
)}
102127
{data.updatedAt && (

src/pages/EditShelterSupply/EditShelterSupply.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const EditShelterSupply = () => {
130130
value: `${SupplyPriority.Remaining}`,
131131
},
132132
{
133-
label: 'Remover item',
133+
label: 'Não preciso',
134134
value: `${SupplyPriority.NotNeeded}`,
135135
},
136136
]}

src/pages/Shelter/Shelter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const Shelter = () => {
107107
</h3>
108108
</div>
109109
<div className="flex gap-2 flex-wrap">
110-
{volunteerTags.map((v, idx) => (
110+
{ volunteerTags.length == 0 ? <p>Não informado. <i> (Pode ser adicionado ao clicar em Editar itens) </i></p> : volunteerTags.map((v, idx) => (
111111
<Chip
112112
className={getSupplyPriorityProps(v.priority).className}
113113
key={idx}

0 commit comments

Comments
 (0)