Skip to content

Commit 43167c9

Browse files
authored
Merge pull request #130 from CreateThrive/bugfix/fetch-user-profile
Bugfix : Issue for fetching user profile
2 parents df731a3 + e0df8b3 commit 43167c9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/pages/Profile/index.jsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import { useSelector, shallowEqual } from 'react-redux';
33

44
import { useFormatMessage } from 'hooks';
@@ -8,12 +8,14 @@ import ChangePassword from './ChangePassword';
88

99
const Profile = () => {
1010
const { userData } = useSelector(
11-
state => ({
12-
userData: state.auth.userData
11+
(state) => ({
12+
userData: state.auth.userData,
1313
}),
1414
shallowEqual
1515
);
1616

17+
const [user, setUser] = useState(userData);
18+
1719
return (
1820
<>
1921
<section className="hero is-hero-bar">
@@ -22,7 +24,13 @@ const Profile = () => {
2224
</div>
2325
</section>
2426
<section className="section is-main-section">
25-
<UserForm isEditing isProfile userData={userData} action={modifyUser} />
27+
<UserForm
28+
isEditing
29+
isProfile
30+
user={user}
31+
setUser={setUser}
32+
action={modifyUser}
33+
/>
2634
<ChangePassword />
2735
</section>
2836
</>

0 commit comments

Comments
 (0)