Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: moves social section to the bottom and vacancies availability to the top #51

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 34 additions & 38 deletions src/components/card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,15 @@ export function Card({ shelter }: Props) {

return (
<CardBase key={shelter.id} className="w-full shadow-md">
<CardHeader>
<div className="flex justify-between">
<h4 className="text-lg font-medium">{shelter.name}</h4>
<div className="flex items-center space-x-3">
{shelter.facebook && (
<SocialLink
href={`https://facebook.com/${unmaskSocialMedia(shelter.facebook)}`}
icon={<FaFacebook size={18} />}
label="Facebook"
/>
)}

{shelter.instagram && (
<SocialLink
href={`https://instagram.com/${unmaskSocialMedia(shelter.instagram)}`}
icon={<FaInstagram size={18} />}
label="Instagram"
/>
)}

{shelter.twitter && (
<SocialLink
href={`https://twitter.com/${unmaskSocialMedia(shelter.twitter)}`}
icon={<RiTwitterXLine size={18} />}
label="Twitter"
/>
)}
</div>
</div>
<CardHeader className="flex flex-col gap-1">
<h4 className="text-lg font-medium">{shelter.name}</h4>
{availableVacancies > 0 ? (
<p className="text-md font-semibold text-green-600">
Vagas disponíveis: {availableVacancies}
</p>
) : (
<p className="text-md font-semibold text-red-600">Vagas esgotadas</p>
)}
<Link
href={`https://www.google.com/maps/search/${fullAddress}`}
target="_blank"
Expand Down Expand Up @@ -101,15 +81,31 @@ dark:ring-offset-neutral-950 dark:hover:bg-neutral-50/90 dark:focus-visible:ring
Entre em contato <FaWhatsapp />
</a>

{availableVacancies > 0 ? (
<p className="text-md text-right font-semibold text-green-600">
Vagas disponíveis: {availableVacancies}
</p>
) : (
<p className="text-md text-right font-semibold text-red-600">
Vagas esgotadas
</p>
)}
<div className="flex items-center space-x-3">
{shelter.facebook && (
<SocialLink
href={`https://facebook.com/${unmaskSocialMedia(shelter.facebook)}`}
icon={<FaFacebook size={20} />}
label="Facebook"
/>
)}

{shelter.instagram && (
<SocialLink
href={`https://instagram.com/${unmaskSocialMedia(shelter.instagram)}`}
icon={<FaInstagram size={20} />}
label="Instagram"
/>
)}

{shelter.twitter && (
<SocialLink
href={`https://twitter.com/${unmaskSocialMedia(shelter.twitter)}`}
icon={<RiTwitterXLine size={20} />}
label="Twitter"
/>
)}
</div>
</CardFooter>
</CardBase>
);
Expand Down