Skip to content

Commit

Permalink
context api
Browse files Browse the repository at this point in the history
  • Loading branch information
XdithyX committed Dec 3, 2022
1 parent 1c01d87 commit b5de6c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/Context/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ const AppContext = React.createContext()
const AppProvider = ({ children }) => {

// const [authenticated,setAuthenticated] = useState(false)

const[actualname,setActualname]=useState('')
const[phno,setPhno]=useState('')
const[userimg,setUserimg]=useState()
return <AppContext.Provider value={{

actualname,setActualname,phno,setPhno,userimg,setUserimg

}}>{children}</AppContext.Provider>
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Editprofileform/Editprofileform.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function Editprofileform({actualname,setActualname,phno,setPhno,userimg,setUseri

"actual_name":actualname,
"phno":phno,
"user_image":userimg,
"user_foriegn":2
"user_image":userimg

})

e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Dashboard = () => {
</Modal.Title>
</Modal.Header>
<Modal.Body>
<Editprofileform actualname={actualname} phno={phno} userimg={userimg}/>
<Editprofileform actualname={actualname} phno={phno} userimg={userimg} setActualname={setActualname} setPhno={setPhno} setUserimg={setUserimg}/>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleClose}>
Expand Down

0 comments on commit b5de6c8

Please sign in to comment.