Skip to content

Commit

Permalink
Feature/f 65 move high hunger countries (#39)
Browse files Browse the repository at this point in the history
* fix: reduce the size of button, remove the text and add tooltip

* feat: change bottom position of alert and change color of the pulse

* feat: move button the right and made the button smaller

* fix: position and size of skeleton

---------

Co-authored-by: Armanpreet Ghotra <[email protected]>
  • Loading branch information
ArmanpreetGhotra and Armanpreet Ghotra authored Nov 18, 2024
1 parent f0af01b commit d79dc36
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
13 changes: 8 additions & 5 deletions src/components/HungerAlert/HungerAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ export default function HungerAlert({ countryMapData }: HungerAlertProps) {
);

return (
<div className="absolute bottom-20 left-20 z-10 cursor-pointer">
<button className={HungerAlertOperations.getPulseClasses()} onClick={toggleModal} type="button">
<p className="text-4xl font-bold mb-2">{countriesWithHighHunger.length}</p>
<p className="text-center font-medium text-sm px-4">Number of Countries with Very High Levels of Hunger</p>
<div className="absolute bottom-0 left-0 z-10 cursor-pointer" style={{ bottom: '18rem', left: '1.86rem' }}>
<button
className={`${HungerAlertOperations.getPulseClasses()} p-1 text-sm`}
onClick={toggleModal}
style={{ width: '4rem', height: '4rem' }}
type="button"
>
<p className="text-4xl">{countriesWithHighHunger.length}</p>
</button>

<PopupModal
isModalOpen={isModalOpen}
toggleModal={toggleModal}
Expand Down
9 changes: 5 additions & 4 deletions src/components/HungerAlert/HungerAlertSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { Skeleton } from '@nextui-org/skeleton';

export default function HungerAlertSkeleton() {
return (
<div className="absolute bottom-20 left-20 z-10 cursor-pointer">
<Skeleton className="rounded-full flex flex-col items-center justify-center text-center bg-white dark:bg-content2 relative p-5">
<div className="w-36 h-36" />
</Skeleton>
<div className="absolute bottom-0 left-0 z-10 cursor-pointer " style={{ bottom: '18rem', left: '1.86rem' }}>
<Skeleton
className="rounded-full flex flex-col items-center justify-center text-center bg-white dark:bg-content2 relative p-5"
style={{ width: '4rem', height: '4rem' }}
/>
</div>
);
}
3 changes: 2 additions & 1 deletion src/components/HungerAlert/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
right: 0;
bottom: 0;
border-radius: 50%;
background: rgba(0, 0, 0, 0.2);
background: #3F3F46;
z-index: -1;
animation: pulse-animation 2s infinite ease-out;
border: 2px solid #f7b750;
}

.pulse::after {
Expand Down

0 comments on commit d79dc36

Please sign in to comment.