Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const App = () => {

const handleLogin = async (credentials) => {
try {
const response = await fetch("http://localhost:5005/api/user/signin", {
const response = await fetch("http://localhost:8005/api/user/signin", {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down Expand Up @@ -64,8 +64,8 @@ const App = () => {
// Define the onSignup function
const onSignup = async (formData) => {
try {
const response = await fetch('http://localhost:5005/api/user/signup', {
method: 'POST',
const response = await fetch("http://localhost:8005/api/user/signup", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
Expand Down Expand Up @@ -135,7 +135,7 @@ const App = () => {
{isAuthenticated && (
<>
<Route path="/user-profile" element={<UserProfile />} />
<Route path="/edit-profile" element={<EditUserProfile/>} />
<Route path="/edit-profile" element={<EditUserProfile />} />
<Route path="/parcel-history" element={<ParcelHistory />} />
<Route path="/send-parcel" element={<SendParcel />} />
<Route path="/notifications" element={<Notifications />} />
Expand Down
67 changes: 67 additions & 0 deletions src/components/ParcelHistory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React, { useState } from "react";

const ParcelHistory = () => {
// Simulated data for parcel history
const parcelHistory = [
{
sender: "John Doe",
recipient: "Alice Smith",
readyForPickupDate: "2023-11-10 14:30",
pickupDate: "2023-11-12 09:15",
status: "Delivered",
location: "Parcel Locker A",
retrievalCode: "12345",
},
{
sender: "John Doe",
recipient: "Alice Smith",
readyForPickupDate: "2023-11-10 14:30",
pickupDate: "2023-11-12 09:15",
status: "Delivered",
location: "Parcel Locker A",
retrievalCode: "12345",
},
// Add more parcel history entries as needed
];

return (
<div className="container mx-auto p-4">
<h2 className=" text-4xl font-bold text-center my-8">
Parcel Information and History
</h2>
<div className="mt-4">
{parcelHistory.map((parcel, index) => (
<div key={index} className="border rounded p-4 mb-4">
<p>
<strong>Sender:</strong> {parcel.sender}
</p>
<p>
<strong>Recipient:</strong> {parcel.recipient}
</p>
<p>
<strong>Ready for Pickup:</strong> {parcel.readyForPickupDate}
</p>
<p>
<strong>Picked up:</strong> {parcel.pickupDate}
</p>
<p>
<strong>Status:</strong> {parcel.status}
</p>
{parcel.status === "Ready for Pickup" && (
<div>
<p>
<strong>Location:</strong> {parcel.location}
</p>
<p>
<strong>Retrieval Code:</strong> {parcel.retrievalCode}
</p>
</div>
)}
</div>
))}
</div>
</div>
);
};

export default ParcelHistory;
6 changes: 3 additions & 3 deletions src/components/UserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Login from "./user/Login";
import Signup from "./user/Signup";
import { Link } from "react-router-dom";

const UserProfile = () => {
const UserProfile = ({ setIsAuthenticated }) => {
const [showLogin, setShowLogin] = useState(true);

const [user, setUser] = useState({
Expand Down Expand Up @@ -83,7 +83,7 @@ const UserProfile = () => {
</tr>
</tbody>
</table>
<Link to={'/edit-profile'}>
<Link to={"/edit-profile"}>
<button className="btn py-2 my-2 bg-black text-white w-full">
Update Information
</button>
Expand All @@ -93,4 +93,4 @@ const UserProfile = () => {
);
};

export default UserProfile;
export default UserProfile;
Loading