generated from goitacademy/react-homework-template
-
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
1 parent
5e59a11
commit e8fef69
Showing
15 changed files
with
36 additions
and
22 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
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
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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { logOut } from '../../redux/auth/operations'; | ||
import { selectUser } from '../../redux/auth/selectors'; | ||
|
||
const UserMenu = () => { | ||
const dispatch = useDispatch(); | ||
const user = useSelector(selectUser); | ||
const dispatch = useDispatch(); | ||
const user = useSelector(selectUser); | ||
|
||
return ( | ||
<dir> | ||
<p>Welcome, {user.name}</p> | ||
<button type="button" onClick={() => dispatch(logOut())}> | ||
Logout | ||
</button> | ||
</dir> | ||
); | ||
} | ||
return ( | ||
<dir> | ||
<p>Welcome, {user.name}</p> | ||
<button type="button" onClick={() => dispatch(logOut())}> | ||
Logout | ||
</button> | ||
</dir> | ||
); | ||
}; | ||
|
||
export default UserMenu; | ||
export default UserMenu; |
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
Empty file.
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,4 @@ | ||
export const selectIsLoggedIn = state => state.auth.isLoggedIn; | ||
export const selectUser = state => state.auth.user; | ||
export const selectIsRefreshing = state => state.auth.isRefreshing; | ||
export const selectErrorLogin = state => state.auth.error; |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.