Skip to content

Commit f0385f2

Browse files
committed
Merge branch 'master' into develop
2 parents 1edb325 + a25af06 commit f0385f2

File tree

7 files changed

+31
-21
lines changed

7 files changed

+31
-21
lines changed

src/components/CardAboutShelter/CardAboutShelter.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ const CardAboutShelter = (props: ICardAboutShelter) => {
1515
const { shelter } = props;
1616

1717
const check = (v?: string | number | boolean | null) => {
18-
return (
19-
(v !== undefined && v !== null) ||
20-
(typeof v === 'number' && v === 0) ||
21-
(typeof v === 'boolean' && v)
22-
);
18+
return v !== undefined && v !== null;
2319
};
2420

2521
return (
@@ -49,8 +45,10 @@ const CardAboutShelter = (props: ICardAboutShelter) => {
4945
icon={<PawPrint />}
5046
label={
5147
check(shelter.petFriendly)
52-
? 'O abrigo aceita animais'
53-
: 'O abrigo não aceita animais'
48+
? shelter.petFriendly
49+
? 'O abrigo aceita animais'
50+
: 'O abrigo não aceita animais'
51+
: 'Não informado se aceita animais'
5452
}
5553
/>
5654
<InfoRow

src/components/ShelterListItem/ShelterListItem.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useMemo } from 'react';
22
import { format } from 'date-fns';
33
import { useNavigate } from 'react-router-dom';
4-
import { ChevronRight } from 'lucide-react';
4+
import { BadgeCheck, ChevronRight } from 'lucide-react';
55

66
import { IShelterListItemProps, IShelterAvailabilityProps } from './types';
77
import { cn, getAvailabilityProps, getSupplyPriorityProps } from '@/lib/utils';
@@ -38,12 +38,17 @@ const ShelterListItem = (props: IShelterListItemProps) => {
3838
>
3939
<ChevronRight className="h-5 w-5" />
4040
</Button>
41-
<h3
42-
className="font-semibold text-lg mr-12 hover:cursor-pointer hover:text-slate-500"
43-
onClick={() => navigate(`/abrigo/${data.id}`)}
44-
>
45-
{data.name}
46-
</h3>
41+
<div className="flex items-center gap-1">
42+
{data.verified && (
43+
<BadgeCheck className="h-5 w-5 stroke-white fill-red-600" />
44+
)}
45+
<h3
46+
className="font-semibold text-lg mr-12 hover:cursor-pointer hover:text-slate-500"
47+
onClick={() => navigate(`/abrigo/${data.id}`)}
48+
>
49+
{data.name}
50+
</h3>
51+
</div>
4752
<h6 className={cn('font-semibold text-md', availabilityClassName)}>
4853
{availability}
4954
</h6>

src/contexts/SessionContext/SessionContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { createContext, useCallback, useEffect, useState } from 'react';
22

3-
import { ISession, ISessionContext } from './types';
3+
import { ISessionContext } from './types';
44
import { SessionServices } from '@/service';
5+
import { ISession } from '@/service/sessions/types';
56

67
const SessionContext = createContext({} as ISessionContext);
78

src/hooks/useShelter/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface IUseShelterData {
88
contact?: string | null;
99
petFriendly?: boolean | null;
1010
prioritySum: number;
11+
verified: boolean;
1112
latitude?: string | null;
1213
longitude?: string | null;
1314
shelterSupplies: IUseShelterDataSupply[];

src/hooks/useShelters/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface IUseSheltersData {
88
contact?: string | null;
99
petFriendly?: boolean | null;
1010
prioritySum: number;
11+
verified: boolean;
1112
latitude?: string | null;
1213
longitude?: string | null;
1314
createdAt: string;

src/pages/Shelter/Shelter.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo } from 'react';
2-
import { ChevronLeft, Pencil } from 'lucide-react';
2+
import { BadgeCheck, ChevronLeft, Pencil } from 'lucide-react';
33
import { useNavigate, useParams } from 'react-router-dom';
44

55
import { CardAboutShelter, Header, LoadingScreen } from '@/components';
@@ -53,9 +53,14 @@ const Shelter = () => {
5353
}
5454
/>
5555
<div className="p-4 flex flex-col max-w-5xl w-full">
56-
<h1 className="text-[#2f2f2f] font-semibold text-2xl">
57-
{shelter.name}
58-
</h1>
56+
<div className="flex items-center gap-1">
57+
{shelter.verified && (
58+
<BadgeCheck className="h-6 w-6 stroke-white fill-red-600" />
59+
)}
60+
<h1 className="text-[#2f2f2f] font-semibold text-2xl">
61+
{shelter.name}
62+
</h1>
63+
</div>
5964
<div className="flex flex-1 items-center justify-between">
6065
<h1 className={cn(availabilityClassName, 'font-semibold')}>
6166
{availability}

src/service/sessions/session.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { ISession } from '../../contexts/SessionContext/types';
21
import { IServerResponse } from '../../types';
32
import { api } from '@/api';
4-
import { IAuthRequest, IAuthResponse } from './types';
3+
import { IAuthRequest, IAuthResponse, ISession } from './types';
54

65
const SessionServices = {
76
auth: async (payload: IAuthRequest): Promise<IAuthResponse> => {

0 commit comments

Comments
 (0)