Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
42bc769d
Unverified
Commit
42bc769d
authored
Sep 10, 2024
by
RoccoSmit
Committed by
GitHub
Sep 10, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: load server name and icon from settings (#3908)
parent
4790e84b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
UserBanner.tsx
web/src/components/UserBanner.tsx
+8
-2
No files found.
web/src/components/UserBanner.tsx
View file @
42bc769d
...
@@ -5,6 +5,9 @@ import { authServiceClient } from "@/grpcweb";
...
@@ -5,6 +5,9 @@ import { authServiceClient } from "@/grpcweb";
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useNavigateTo
from
"@/hooks/useNavigateTo"
;
import
useNavigateTo
from
"@/hooks/useNavigateTo"
;
import
{
Routes
}
from
"@/router"
;
import
{
Routes
}
from
"@/router"
;
import
{
useWorkspaceSettingStore
}
from
"@/store/v1"
;
import
{
WorkspaceGeneralSetting
}
from
"@/types/proto/api/v1/workspace_setting_service"
;
import
{
WorkspaceSettingKey
}
from
"@/types/proto/store/workspace_setting"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
UserAvatar
from
"./UserAvatar"
;
import
UserAvatar
from
"./UserAvatar"
;
...
@@ -17,8 +20,11 @@ const UserBanner = (props: Props) => {
...
@@ -17,8 +20,11 @@ const UserBanner = (props: Props) => {
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
navigateTo
=
useNavigateTo
();
const
navigateTo
=
useNavigateTo
();
const
user
=
useCurrentUser
();
const
user
=
useCurrentUser
();
const
title
=
user
?
user
.
nickname
||
user
.
username
:
"Memos"
;
const
workspaceSettingStore
=
useWorkspaceSettingStore
();
const
avatarUrl
=
user
?
user
.
avatarUrl
:
"/full-logo.webp"
;
const
workspaceGeneralSetting
=
workspaceSettingStore
.
getWorkspaceSettingByKey
(
WorkspaceSettingKey
.
GENERAL
).
generalSetting
||
WorkspaceGeneralSetting
.
fromPartial
({});
const
title
=
user
?
user
.
nickname
||
user
.
username
:
workspaceGeneralSetting
.
customProfile
?.
title
;
const
avatarUrl
=
user
?
user
.
avatarUrl
:
workspaceGeneralSetting
.
customProfile
?.
logoUrl
;
const
handleSignOut
=
async
()
=>
{
const
handleSignOut
=
async
()
=>
{
await
authServiceClient
.
signOut
({});
await
authServiceClient
.
signOut
({});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment