-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad041cf
commit 07a9c53
Showing
4 changed files
with
36 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,20 @@ | ||
"use client"; | ||
|
||
import { useEffect, useState } from "react"; | ||
import CustomerDashboardBox from "../../../Components/CustomerDashboardBox"; | ||
import { User } from "@/types.index"; | ||
|
||
const userData = { | ||
Name: "abc abc", | ||
|
||
Email: "[email protected]", | ||
|
||
Address: "123 Main Street", | ||
|
||
Pincode: "123456", | ||
|
||
DateOfBirth: "00-00-0000", | ||
|
||
City: "Visnagar", | ||
|
||
State: "Gujarat", | ||
|
||
Country: "India", | ||
|
||
phone: "90000 00000", | ||
const page = () => { | ||
const [userData, setUserData] = useState<User>({}); | ||
|
||
customer: "true", | ||
useEffect(() => { | ||
const UserFromLocalStorage = localStorage.getItem("User"); | ||
const user = JSON.parse(UserFromLocalStorage) | ||
console.log(user); | ||
setUserData(user) | ||
}, []) | ||
|
||
seller: "false", | ||
}; | ||
|
||
const page = () => { | ||
const displayedUserData = Object.fromEntries( | ||
Object.entries(userData).filter( | ||
([key]) => key !== "customer" && key !== "seller" | ||
|
@@ -40,7 +28,7 @@ const page = () => { | |
|
||
<main className="w-4/5 p-6"> | ||
<h2 className="text-2xl font-semibold mb-4 text-gray-800"> | ||
Customer Profile Page | ||
Customer Profile Page | ||
</h2> | ||
|
||
<div className="flex items-center space-x-6"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export interface User { | ||
address: string, | ||
city: string, | ||
country: string, | ||
dateOfBirth: string, | ||
email: string, | ||
isSeller: boolean, | ||
name: string, | ||
phone: string | ||
photo: string, | ||
pincode: string, | ||
state: string, | ||
uid: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { db } from "@/firebase/config"; | ||
import { collection, getDocs} from "firebase/firestore"; | ||
|
||
export const GetDataFromCollection = async (collectionName: string) => { | ||
const querySnapshot = await getDocs(collection(db, collectionName)); | ||
return querySnapshot.docs; | ||
} |