-
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
Showing
4 changed files
with
36 additions
and
28 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,36 +1,21 @@ | ||
"use client"; | ||
|
||
import { useEffect, useState } from "react"; | ||
import CustomerDashboardBox from "../../../Components/CustomerDashboardBox"; | ||
import Button from "@mui/material/Button"; | ||
import { usePathname } from "next/navigation"; | ||
import { User } from "@/types.index"; | ||
import { Button } from "@mui/material"; | ||
import Link from "next/link"; | ||
|
||
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", | ||
|
||
customer: "true", | ||
|
||
seller: "false", | ||
}; | ||
|
||
const page = () => { | ||
const pathname = usePathname(); | ||
const [userData, setUserData] = useState<User>({}); | ||
|
||
useEffect(() => { | ||
const UserFromLocalStorage = localStorage.getItem("User"); | ||
const user = JSON.parse(UserFromLocalStorage) | ||
console.log(user); | ||
setUserData(user) | ||
}, []) | ||
|
||
const displayedUserData = Object.fromEntries( | ||
Object.entries(userData).filter( | ||
|
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; | ||
} |