Skip to content

Commit

Permalink
feat: product details implementation (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgongora authored Nov 11, 2024
1 parent 8ec6ace commit 961b159
Show file tree
Hide file tree
Showing 29 changed files with 981 additions and 9 deletions.
Binary file added apps/web/public/images/Avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/web/public/images/product-details/Discount-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/web/public/images/product-details/Flame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/web/public/images/product-details/Menu-4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/web/public/images/product-details/SandClock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/web/public/images/product-details/Shopping-bag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/web/public/images/product-details/producer-info/Send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/web/public/images/product-details/producer-info/Star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/web/public/images/product-details/producer-info/farm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions apps/web/src/app/_components/features/FarmModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import Button from "@repo/ui/button";
import BottomModal from "~/app/_components/ui/BottomModal";

interface FarmModalProps {
isOpen: boolean;
onClose: () => void;
farmData: {
name: string;
since: string;
bio: string;
experiences: string;
goodPractices: string;
};
isEditable?: boolean;
onEdit: () => void;
}

function FarmModal({
isOpen,
onClose,
farmData,
isEditable,
onEdit,
}: FarmModalProps) {
return (
<BottomModal isOpen={isOpen} onClose={onClose}>
<div className="flex flex-col items-center w-full">
<div className="w-full max-w-[24.375rem]">
<div className="flex flex-col gap-6">
<div>
<h3 className="text-2xl font-bold text-content-title">
{farmData.name}
</h3>
<p className="text-sm text-content-body-default">
producing coffee since {farmData.since}
</p>
</div>

<div>
<h4 className="text-base font-semibold mb-2">Bio</h4>
<p className="text-base text-content-title">{farmData.bio}</p>
</div>

<div>
<h4 className="text-base font-semibold mb-2">Experiences</h4>
<p className="text-base text-content-title">
{farmData.experiences}
</p>
</div>

<div>
<h4 className="text-base font-semibold mb-2">Good practices</h4>
<p className="text-base text-content-title">
{farmData.goodPractices}
</p>
</div>

{isEditable && (
<Button onClick={onEdit} className="w-full">
Edit
</Button>
)}
</div>
</div>
</div>
</BottomModal>
);
}

export { FarmModal };
Loading

0 comments on commit 961b159

Please sign in to comment.