-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π getAdmin api integrated with profile page issue#767 (#902)
* getAdmin api integrated * undefined removed from ui of admin profile
- Loading branch information
1 parent
98bcd3d
commit 349dcff
Showing
3 changed files
with
38 additions
and
11 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
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 |
---|---|---|
|
@@ -3,17 +3,20 @@ import EditIcon from "@material-ui/icons/Edit"; | |
import CloseIcon from "@material-ui/icons/Close"; | ||
import style from "./profile.module.scss"; | ||
|
||
export function Profile() { | ||
export function Profile(props) { | ||
const [name, setName] = useState("Super Admin Name"); | ||
const [email, setEmail] = useState("[email protected]"); | ||
const [phone, setPhone] = useState("+91-123456789"); | ||
const [edit, setEdit] = useState(false); | ||
|
||
useEffect(() => { | ||
setName(localStorage.getItem("firstName")); | ||
setEmail(localStorage.getItem("email")); | ||
setPhone(localStorage.getItem("phone")); | ||
},[setName,setEmail,setPhone]) | ||
let firstName = props.adminData.firstName ? props.adminData.firstName : ""; | ||
let lastName = props.adminData.lastName ? props.adminData.lastName : ""; | ||
let Name = firstName + " " + lastName; | ||
setName(Name); | ||
setEmail(props.adminData.email); | ||
setPhone(props.adminData.contact); | ||
}, props); | ||
|
||
return ( | ||
<div className={style["profile-container"]}> | ||
|
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