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
3245613a
Commit
3245613a
authored
Oct 12, 2025
by
Copilot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: cleanup components naming
parent
54e3c134
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
MemosLogo.tsx
web/src/components/MemosLogo.tsx
+2
-2
Navigation.tsx
web/src/components/Navigation.tsx
+4
-4
UserMenu.tsx
web/src/components/UserMenu.tsx
+17
-2
No files found.
web/src/components/
BrandBanner
.tsx
→
web/src/components/
MemosLogo
.tsx
View file @
3245613a
...
@@ -8,7 +8,7 @@ interface Props {
...
@@ -8,7 +8,7 @@ interface Props {
collapsed
?:
boolean
;
collapsed
?:
boolean
;
}
}
const
BrandBanner
=
observer
((
props
:
Props
)
=>
{
const
MemosLogo
=
observer
((
props
:
Props
)
=>
{
const
{
collapsed
}
=
props
;
const
{
collapsed
}
=
props
;
const
workspaceGeneralSetting
=
workspaceStore
.
state
.
generalSetting
;
const
workspaceGeneralSetting
=
workspaceStore
.
state
.
generalSetting
;
const
title
=
workspaceGeneralSetting
.
customProfile
?.
title
||
"Memos"
;
const
title
=
workspaceGeneralSetting
.
customProfile
?.
title
||
"Memos"
;
...
@@ -24,4 +24,4 @@ const BrandBanner = observer((props: Props) => {
...
@@ -24,4 +24,4 @@ const BrandBanner = observer((props: Props) => {
);
);
});
});
export
default
BrandBanner
;
export
default
MemosLogo
;
web/src/components/Navigation.tsx
View file @
3245613a
...
@@ -8,8 +8,8 @@ import { cn } from "@/lib/utils";
...
@@ -8,8 +8,8 @@ import { cn } from "@/lib/utils";
import
{
Routes
}
from
"@/router"
;
import
{
Routes
}
from
"@/router"
;
import
{
userStore
}
from
"@/store"
;
import
{
userStore
}
from
"@/store"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
BrandBanner
from
"./BrandBanner
"
;
import
MemosLogo
from
"./MemosLogo
"
;
import
User
Banner
from
"./UserBanner
"
;
import
User
Menu
from
"./UserMenu
"
;
interface
NavLinkItem
{
interface
NavLinkItem
{
id
:
string
;
id
:
string
;
...
@@ -67,7 +67,7 @@ const Navigation = observer((props: Props) => {
...
@@ -67,7 +67,7 @@ const Navigation = observer((props: Props) => {
<
header
className=
{
cn
(
"w-full h-full overflow-auto flex flex-col justify-between items-start gap-4 hide-scrollbar"
,
className
)
}
>
<
header
className=
{
cn
(
"w-full h-full overflow-auto flex flex-col justify-between items-start gap-4 hide-scrollbar"
,
className
)
}
>
<
div
className=
"w-full px-1 py-1 flex flex-col justify-start items-start space-y-2 overflow-auto overflow-x-hidden hide-scrollbar shrink"
>
<
div
className=
"w-full px-1 py-1 flex flex-col justify-start items-start space-y-2 overflow-auto overflow-x-hidden hide-scrollbar shrink"
>
<
NavLink
className=
"mb-3 cursor-default"
to=
{
currentUser
?
Routes
.
ROOT
:
Routes
.
EXPLORE
}
>
<
NavLink
className=
"mb-3 cursor-default"
to=
{
currentUser
?
Routes
.
ROOT
:
Routes
.
EXPLORE
}
>
<
BrandBanner
collapsed=
{
collapsed
}
/>
<
MemosLogo
collapsed=
{
collapsed
}
/>
</
NavLink
>
</
NavLink
>
{
navLinks
.
map
((
navLink
)
=>
(
{
navLinks
.
map
((
navLink
)
=>
(
<
NavLink
<
NavLink
...
@@ -105,7 +105,7 @@ const Navigation = observer((props: Props) => {
...
@@ -105,7 +105,7 @@ const Navigation = observer((props: Props) => {
</
div
>
</
div
>
{
currentUser
&&
(
{
currentUser
&&
(
<
div
className=
{
cn
(
"w-full flex flex-col justify-end"
,
props
.
collapsed
?
"items-center"
:
"items-start pl-3"
)
}
>
<
div
className=
{
cn
(
"w-full flex flex-col justify-end"
,
props
.
collapsed
?
"items-center"
:
"items-start pl-3"
)
}
>
<
User
Banner
collapsed=
{
collapsed
}
/>
<
User
Menu
collapsed=
{
collapsed
}
/>
</
div
>
</
div
>
)
}
)
}
</
header
>
</
header
>
...
...
web/src/components/User
Banner
.tsx
→
web/src/components/User
Menu
.tsx
View file @
3245613a
...
@@ -12,7 +12,7 @@ interface Props {
...
@@ -12,7 +12,7 @@ interface Props {
collapsed
?:
boolean
;
collapsed
?:
boolean
;
}
}
const
User
Banner
=
(
props
:
Props
)
=>
{
const
User
Menu
=
(
props
:
Props
)
=>
{
const
{
collapsed
}
=
props
;
const
{
collapsed
}
=
props
;
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
navigateTo
=
useNavigateTo
();
const
navigateTo
=
useNavigateTo
();
...
@@ -20,6 +20,21 @@ const UserBanner = (props: Props) => {
...
@@ -20,6 +20,21 @@ const UserBanner = (props: Props) => {
const
handleSignOut
=
async
()
=>
{
const
handleSignOut
=
async
()
=>
{
await
authServiceClient
.
deleteSession
({});
await
authServiceClient
.
deleteSession
({});
// Clear user-specific localStorage items (e.g., drafts)
// Preserve app-wide settings like theme
const
keysToPreserve
=
[
"memos-theme"
,
"tag-view-as-tree"
,
"tag-tree-auto-expand"
,
"viewStore"
];
const
keysToRemove
:
string
[]
=
[];
for
(
let
i
=
0
;
i
<
localStorage
.
length
;
i
++
)
{
const
key
=
localStorage
.
key
(
i
);
if
(
key
&&
!
keysToPreserve
.
includes
(
key
))
{
keysToRemove
.
push
(
key
);
}
}
keysToRemove
.
forEach
((
key
)
=>
localStorage
.
removeItem
(
key
));
window
.
location
.
href
=
Routes
.
AUTH
;
window
.
location
.
href
=
Routes
.
AUTH
;
};
};
...
@@ -65,4 +80,4 @@ const UserBanner = (props: Props) => {
...
@@ -65,4 +80,4 @@ const UserBanner = (props: Props) => {
);
);
};
};
export
default
User
Banner
;
export
default
User
Menu
;
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