Skip to content

Commit

Permalink
Merge pull request #14 from SOS-RS/feat/verified
Browse files Browse the repository at this point in the history
feat: added verified seal to shelters
  • Loading branch information
rhuam authored May 8, 2024
2 parents 73eb1fc + fcdd0b6 commit ee8c0b7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
19 changes: 12 additions & 7 deletions src/components/ShelterListItem/ShelterListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import { format } from 'date-fns';
import { useNavigate } from 'react-router-dom';
import { ChevronRight } from 'lucide-react';
import { BadgeCheck, ChevronRight } from 'lucide-react';

import { IShelterListItemProps, IShelterAvailabilityProps } from './types';
import { cn, getAvailabilityProps, getSupplyPriorityProps } from '@/lib/utils';
Expand Down Expand Up @@ -38,12 +38,17 @@ const ShelterListItem = (props: IShelterListItemProps) => {
>
<ChevronRight className="h-5 w-5" />
</Button>
<h3
className="font-semibold text-lg mr-12 hover:cursor-pointer hover:text-slate-500"
onClick={() => navigate(`/abrigo/${data.id}`)}
>
{data.name}
</h3>
<div className="flex items-center gap-1">
{data.verified && (
<BadgeCheck className="h-5 w-5 stroke-white fill-red-600" />
)}
<h3
className="font-semibold text-lg mr-12 hover:cursor-pointer hover:text-slate-500"
onClick={() => navigate(`/abrigo/${data.id}`)}
>
{data.name}
</h3>
</div>
<h6 className={cn('font-semibold text-md', availabilityClassName)}>
{availability}
</h6>
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useShelter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface IUseShelterData {
contact?: string | null;
petFriendly?: boolean | null;
prioritySum: number;
verified: boolean;
latitude?: string | null;
longitude?: string | null;
shelterSupplies: IUseShelterDataSupply[];
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useShelters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface IUseSheltersData {
contact?: string | null;
petFriendly?: boolean | null;
prioritySum: number;
verified: boolean;
latitude?: string | null;
longitude?: string | null;
createdAt: string;
Expand Down
13 changes: 9 additions & 4 deletions src/pages/Shelter/Shelter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { ChevronLeft, Pencil } from 'lucide-react';
import { BadgeCheck, ChevronLeft, Pencil } from 'lucide-react';
import { useNavigate, useParams } from 'react-router-dom';

import { CardAboutShelter, Header, LoadingScreen } from '@/components';
Expand Down Expand Up @@ -53,9 +53,14 @@ const Shelter = () => {
}
/>
<div className="p-4 flex flex-col max-w-5xl w-full">
<h1 className="text-[#2f2f2f] font-semibold text-2xl">
{shelter.name}
</h1>
<div className="flex items-center gap-1">
{shelter.verified && (
<BadgeCheck className="h-6 w-6 stroke-white fill-red-600" />
)}
<h1 className="text-[#2f2f2f] font-semibold text-2xl">
{shelter.name}
</h1>
</div>
<div className="flex flex-1 items-center justify-between">
<h1 className={cn(availabilityClassName, 'font-semibold')}>
{availability}
Expand Down

0 comments on commit ee8c0b7

Please sign in to comment.