diff --git a/src/common/components/Footer/Footer.tsx b/src/common/components/Footer/Footer.tsx index 30a6f10..ac19edd 100644 --- a/src/common/components/Footer/Footer.tsx +++ b/src/common/components/Footer/Footer.tsx @@ -30,7 +30,7 @@ export default function Footer() { - + diff --git a/src/common/components/Header/Header.tsx b/src/common/components/Header/Header.tsx index f992fd1..e657b4c 100644 --- a/src/common/components/Header/Header.tsx +++ b/src/common/components/Header/Header.tsx @@ -4,8 +4,24 @@ import Image from "next/image"; import * as ROUTES from "../../../constants/routes"; import NotificationBell from "../NotificationBell/NotificationBell"; import styles from "./Header.module.css"; +import { useState,useEffect } from "react"; export default function Header() { + + const [userDetails , setUserdetails] = useState(null); + + useEffect(() => { + try{ + const data = localStorage.getItem("authUser"); + + if(data){ + setUserdetails(JSON.parse(data)); + }; + }catch (e){ + console.log(e); + } + },[]) + return ( <>
@@ -31,10 +47,18 @@ export default function Header() {
- + {(userDetails)? + ( + + ) : + ( + ) + }
diff --git a/src/common/components/Profile/Profile.module.css b/src/common/components/Profile/Profile.module.css index d27bbdb..7149911 100644 --- a/src/common/components/Profile/Profile.module.css +++ b/src/common/components/Profile/Profile.module.css @@ -595,6 +595,51 @@ font-family: ui-monospace, SFMono-Regular, Monaco, monospace; } +/* Edit Profile CSS */ +.editOverlay{ + border:2px solid black; + border-radius:30px; + padding:15px; +} + +.formGroup{ + margin:5px; +} + +.formGroup input{ + border:1px solid black; + margin-left: 5px; + border-radius: 25px; + padding:5px; + width:100%; +} + +.cancelBtn{ + border: 1px solid black; + padding:5px; + margin:5px; + border-radius: 30px; +} + +.cancelBtn:hover{ + background-color: lightcoral; +} + +.saveBtn{ + border: 1px solid black; + padding:5px; + margin:5px; + border-radius: 30px; +} + +.saveBtn:hover{ + background-color: lightgreen; +} + +.errorMessage{ + color:lightcoral; +} + /* Responsiveness */ @media (max-width: 1280px) { .topSection { diff --git a/src/common/components/Profile/Profile.tsx b/src/common/components/Profile/Profile.tsx index 4b1b4f8..9581a49 100644 --- a/src/common/components/Profile/Profile.tsx +++ b/src/common/components/Profile/Profile.tsx @@ -269,7 +269,7 @@ export default function Profile({ userId }: ProfileProps) { {isOwnProfile && ( )} @@ -451,7 +451,7 @@ export default function Profile({ userId }: ProfileProps) {
diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 826eded..1b9beb2 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -14,6 +14,8 @@ import dynamic from "next/dynamic"; import Loading from "../common/components/Loading/Loading"; import Link from "next/link"; +import { useState,useEffect } from "react"; + const DynamicHeader = dynamic(() => import("../common/components/Header/Header"), { loading: () => }); @@ -23,6 +25,21 @@ const DynamicFooter = dynamic(() => import("../common/components/Footer/Footer") }); export default function Home() { + + const [userDetail, setUserDetail] = useState(null); + + useEffect(() => { + try { + const data = localStorage.getItem("authUser"); + + if (data) { + setUserDetail(JSON.parse(data)); + } + } catch (e) { + console.log(e); + } + }, []); + return (
@@ -45,14 +62,14 @@ export default function Home() {

{/* Explore Button*/} - + {/* Dashboard Button*/} - +