feat(profile): display dynamic user data from context

The previous profile page was a static placeholder using hardcoded data. This commit refactors the entire component to fetch and display real user information from the `useUser` context, making the page functional.

Key changes include:
- Replaced static `useState` with the `useUser` context hook for data fetching.
- Completely overhauled the UI for a cleaner, more organized, and responsive layout.
- Displays dynamic user details such as full name, email, phone number, and join date.
- Implemented a `Status` component to visually indicate email and phone verification status.
- Added an error fallback for the profile image, showing a default user icon if the image fails to load.
- Removed the previous local state management and image upload logic.
This commit is contained in:
AmirReza Jamali
2025-09-30 17:31:02 +03:30
parent 1ddc1ce0e6
commit 53db465a24
3 changed files with 124 additions and 153 deletions
+3 -3
View File
@@ -2,11 +2,11 @@ import { cn } from "@/lib/utils";
import { ReactNode } from "react";
interface IProps {
status: string;
status?: string;
children: ReactNode;
}
const Status = ({ status, children }: IProps) => {
const Status = ({ status = "draft", children }: IProps) => {
const reds = [
"cancelled",
"inactive",
@@ -22,7 +22,7 @@ const Status = ({ status, children }: IProps) => {
"success",
"verified",
"published",
"sent"
"sent",
];
const blues = ["awarded", "processing", "in-review", "scheduled"];
const yellows = ["pending", "warning", "on-hold", "delayed"];