summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js')
-rw-r--r--opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js b/opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js
index 291c0068..70f5b884 100644
--- a/opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js
+++ b/opendc-web/opendc-web-ui/src/containers/auth/ProfileName.js
@@ -1,9 +1,9 @@
import React from 'react'
-import { useSelector } from 'react-redux'
+import { useAuth } from '../../auth'
function ProfileName() {
- const name = useSelector((state) => `${state.auth.givenName} ${state.auth.familyName}`)
- return <span>{name}</span>
+ const { isLoading, user } = useAuth()
+ return isLoading ? <span>Loading...</span> : <span>{user.name}</span>
}
export default ProfileName