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: product details implementation #48

Merged
merged 9 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
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
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
Loading