Skip to content

Commit

Permalink
feat: update request details
Browse files Browse the repository at this point in the history
  • Loading branch information
eman-bfloat committed Dec 11, 2024
1 parent ecfaf3e commit be7432b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
13 changes: 12 additions & 1 deletion apps/courier/src/pages/requests/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import { ListDeliveryRequests } from "@sahil/features/Deliveries/ListDeliveryRequests";
import { Button } from "ui";
import { HiOutlineArrowRight } from "react-icons/hi2";

export default function Requests() {
return (
<section className="p-4">
<section className="p-4 space-y-4">
<div className="flex justify-between items-start">
<div className="space-y-2">
<h3 className="text-2xl font-bold">Hello, James</h3>
<p className="text-sm text-gray-500">Here are your delivery requests</p>
</div>
<div>
<Button variant="outline" className="text-sm btn-sm" size="sm"> Past Requests <HiOutlineArrowRight /></Button>
</div>
</div>
<ListDeliveryRequests />
</section>
);
Expand Down
26 changes: 11 additions & 15 deletions packages/features/Deliveries/DeliveryRequestOverviewCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC } from "react";
import { Card } from "ui";
import { Card, Button } from "ui";
import { HiCalendarDays, HiOutlineArrowRight } from "react-icons/hi2";
import Link from "next/link";

Expand All @@ -10,34 +10,30 @@ export const DeliveryRequestOverviewCard: FC<{ request: any }> = ({ request }) =
const updatedDate = new Date(request.updated_at);

return (
<Card title={`Request ID: ${request.id.slice(0, 8)}`} titleSize="sm">
<Card className="space-y-4">
<div className="flex justify-between">
<div>
<h3 className="text-sm card-title">Request ID: ${request.id.slice(0, 8)}</h3>
</div>
<div className="flex gap-2">
<div className="badge gap-2 text-sm text-gray-500">
<HiCalendarDays />
{request.status}
</div>
<p className="text-sm text-gray-500">{createdDate.toLocaleDateString()}</p>
</div>
</div>
<div className="flex justify-between">
<p className="text-sm text-gray-500">{createdDate.toLocaleTimeString()}</p>
<p className="text-sm text-gray-500">Courier ID: {request?.courierId?.slice(0, 8)}</p>
</div>
<div className="flex justify-between">
<p className="text-sm text-gray-500">Delivery Method: {request.delivery_method || 'Not specified'}</p>
<p className="text-sm text-gray-500">Orders: {request.delivery_request_orders.length}</p>
</div>
<p className="text-sm text-gray-500">Last Updated: {updatedDate.toLocaleString()}</p>
{hasActions && (
<div className="flex gap-4">
<button className="btn btn-sm btn-primary">Accept</button>
<button className="btn btn-sm">Decline</button>
</div>
)}
<Link href={`/requests/${request.id}`} className="btn btn-sm rounded-lg border border-[#067a46]/20 border-b-[#067a46]/70 border-t-[#067a46]/70 bg-gradient-to-b from-[#067a46] to-[#056a3e] px-4 pb-3 pt-2.5 font-medium leading-none text-white antialiased shadow-md ring-2 ring-[#067a46]">
<span className="drop-shadow-sm">View Details</span> <HiOutlineArrowRight />
</Link>


<div className="flex justify-between items-center gap-2">
<button className="btn btn-sm btn-primary grow">Accept</button>
<button className="btn btn-sm grow">Decline</button>
</div>
</Card>
);
};
4 changes: 2 additions & 2 deletions packages/features/Maps/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const destination = {
const currentLocation = {
id: 6,
name: "Current Location",
lat: -1.9446,
lng: 30.0593,
lat: -1.94815,
lng: 30.06057,
icon: HiOutlineArrowUpCircle,
type: "CurrentLocation",
};
Expand Down

0 comments on commit be7432b

Please sign in to comment.