Skip to content

Commit fd8bb2b

Browse files
author
Your Name
committed
modified the profile and images folder
1 parent 952062c commit fd8bb2b

File tree

9 files changed

+22
-7
lines changed

9 files changed

+22
-7
lines changed
-76.8 KB
Binary file not shown.
File renamed without changes.

fruitguard/src/app/Login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function SignInForm() {
4646
return (
4747
<>
4848
<Image
49-
src="/images/Group 239208.png"
49+
src="/images/fruitguard-logo.png"
5050
alt="FruitGuard Logo"
5151
width={100}
5252
height={100}

fruitguard/src/app/Register/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function Register() {
7070
</div>
7171
<div className="w-1/2 flex items-center justify-center">
7272
<div className="w-full max-w-md p-6">
73-
<Image src="/images/Group 239208.png" alt="FruitGuard Logo" width={100} height={100} className="mx-auto mb-10" priority/>
73+
<Image src="/images/fruitguard-logo.png" alt="FruitGuard Logo" width={100} height={100} className="mx-auto mb-10" priority/>
7474
<form onSubmit={handleSubmit} className="space-y-4">
7575
<div>
7676
<label htmlFor="first_name" className="block text-sm font-bold mb-1 text-xl">First Name</label>

fruitguard/src/app/profile/page.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ const mockedUpdateProfile = updateProfile as jest.Mock;
1515
describe('ProfilePage', () => {
1616
beforeEach(() => {
1717
jest.clearAllMocks();
18+
jest.spyOn(Storage.prototype, 'getItem').mockImplementation((key) => {
19+
if (key === 'token') {
20+
return 'test-token';
21+
}
22+
return null;
23+
});
1824
});
1925

2026
test('shows loading state when loading profile', () => {

fruitguard/src/app/profile/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ import { useEffect,useState } from "react";
44
import useProfile from "../hooks/useFetchProfile";
55
import { updateProfile } from "../utils/updateProfile";
66
import { HiOutlinePencilAlt } from "react-icons/hi";
7-
import AdminLayout from "../sharedComponents/AdminLayout";
87
import Button from "../sharedComponents/Button";
98
import Image from "next/image";
109

11-
const token = process.env.NEXT_PUBLIC_API_TOKEN || "";
1210

1311
export default function Profile() {
12+
const [token,setToken]=useState("")
13+
useEffect(()=>{
14+
const storedToken =localStorage.getItem("token");
15+
if (storedToken){
16+
setToken(storedToken);
17+
}
18+
},[]);
1419
const {profile, loading, error } = useProfile(token);
1520
const [formData, setFormData] = useState({first_name: "", last_name: "", email: "",});
1621
const [profileImage, setProfileImage] = useState<File |null>(null);
@@ -30,6 +35,10 @@ export default function Profile() {
3035
setFormData((oldData) => ({...oldData,[name]: value }));}
3136

3237
async function handleSubmit(event: React.FormEvent) {event.preventDefault();
38+
if (!token){
39+
setUpdateError("No authorization token found")
40+
return;
41+
}
3342
setUpdating(true);
3443
setUpdateError(null);
3544
setUpdateSuccess(false);

fruitguard/src/app/roles/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function Roles() {
1313
<div className="relative mb-12 mt-16 sm:mt-24 md:-mt-50">
1414
<div className="flex justify-center">
1515
<Image
16-
src="/Images/fruitguard.png"
16+
src="/images/fruitguard.png"
1717
alt="FruitGuard logo"
1818
width={150}
1919
height={80}

fruitguard/src/app/sharedComponents/Sidebar/AdminSidebar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default function AdminSidebar() {
8585
</aside>
8686

8787
{showLogoutConfirm && (
88-
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50">
88+
<div className="fixed inset-0 bg-[#7B4F30]/70 flex justify-center items-center z-50">
8989
<div className="bg-white rounded-lg shadow-lg p-8 w-100 text-center">
9090
<h2 className="text-xl font-semibold mb-6 text-[#683929]">
9191
Do you want to logout?

fruitguard/src/app/sharedComponents/Sidebar/AgrovetSidebar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function AgrovetSidebar() {
8282
</aside>
8383

8484
{showLogoutConfirm && (
85-
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50">
85+
<div className="fixed inset-0 bg-[#7B4F30]/70 flex justify-center items-center z-50">
8686
<div className="bg-white rounded-lg shadow-lg p-8 w-100 text-center">
8787
<h2 className="text-xl font-semibold mb-6 text-[#683929]">
8888
Do you want to logout?

0 commit comments

Comments
 (0)