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
35504cc8
Unverified
Commit
35504cc8
authored
Apr 14, 2026
by
boojack
Committed by
GitHub
Apr 14, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(web): add demo mode banner (#5836)
parent
101704c8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
6 deletions
+39
-6
MainLayout.tsx
web/src/layouts/MainLayout.tsx
+3
-6
RootLayout.tsx
web/src/layouts/RootLayout.tsx
+22
-0
en.json
web/src/locales/en.json
+5
-0
zh-Hans.json
web/src/locales/zh-Hans.json
+5
-0
zh-Hant.json
web/src/locales/zh-Hant.json
+4
-0
No files found.
web/src/layouts/MainLayout.tsx
View file @
35504cc8
...
...
@@ -13,11 +13,8 @@ import { Routes } from "@/router";
const
ARCHIVED_ROUTE
=
"/archived"
;
const
PROFILE_ROUTE
=
"/u/:username"
;
const
DESKTOP_EXPLORER_WIDTH_CLASS
=
"w-64"
;
const
DESKTOP_EXPLORER_CLASS_NAME
=
cn
(
"fixed top-0 left-16 h-svh shrink-0 border-r border-border transition-all"
,
DESKTOP_EXPLORER_WIDTH_CLASS
,
);
const
MAIN_CONTENT_CLASS_NAME
=
cn
(
"w-full min-h-full"
,
"md:pl-64"
);
const
DESKTOP_EXPLORER_CLASS_NAME
=
cn
(
"sticky top-0 h-svh shrink-0 border-r border-border transition-all"
,
DESKTOP_EXPLORER_WIDTH_CLASS
);
const
MAIN_CONTENT_CLASS_NAME
=
"w-full min-h-full min-w-0 flex-1"
;
const
MainLayout
=
()
=>
{
const
md
=
useMediaQuery
(
"md"
);
...
...
@@ -71,7 +68,7 @@ const MainLayout = () => {
const
memoExplorerProps
=
{
context
,
statisticsData
:
statistics
,
tagCount
:
tags
};
return
(
<
section
className=
"@container w-full min-h-full flex flex-col justify-start items-center"
>
<
section
className=
"@container w-full min-h-full flex flex-col justify-start items-center
md:flex-row md:items-start
"
>
{
!
md
&&
(
<
MobileHeader
>
<
MemoExplorerDrawer
{
...
memoExplorerProps
}
/>
...
...
web/src/layouts/RootLayout.tsx
View file @
35504cc8
...
...
@@ -2,6 +2,7 @@ import { useEffect, useMemo } from "react";
import
{
Outlet
,
useLocation
,
useSearchParams
}
from
"react-router-dom"
;
import
usePrevious
from
"react-use/lib/usePrevious"
;
import
Navigation
from
"@/components/Navigation"
;
import
{
useInstance
}
from
"@/contexts/InstanceContext"
;
import
{
useMemoFilterContext
}
from
"@/contexts/MemoFilterContext"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useMediaQuery
from
"@/hooks/useMediaQuery"
;
...
...
@@ -9,6 +10,25 @@ import useNavigateTo from "@/hooks/useNavigateTo";
import
{
cn
}
from
"@/lib/utils"
;
import
{
ROUTES
}
from
"@/router/routes"
;
import
{
redirectOnAuthFailure
}
from
"@/utils/auth-redirect"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
const
MEMOS_DEPLOY_URL
=
"https://usememos.com/docs/deploy"
;
const
DemoBanner
=
()
=>
{
const
t
=
useTranslate
();
return
(
<
div
className=
"static w-full border-b border-border bg-muted/70 px-4 py-2 text-sm text-muted-foreground sm:px-6"
>
<
div
className=
"mx-auto flex max-w-5xl flex-col items-start gap-1 sm:flex-row sm:items-center sm:justify-center sm:gap-2"
>
<
span
className=
"font-medium text-foreground"
>
{
t
(
"demo.banner-title"
)
}
</
span
>
<
span
>
{
t
(
"demo.banner-description"
)
}
</
span
>
<
a
className=
"font-medium text-primary underline-offset-4 hover:underline"
href=
{
MEMOS_DEPLOY_URL
}
target=
"_blank"
rel=
"noreferrer"
>
{
t
(
"demo.deploy-link"
)
}
</
a
>
</
div
>
</
div
>
);
};
const
RootLayout
=
()
=>
{
const
location
=
useLocation
();
...
...
@@ -16,6 +36,7 @@ const RootLayout = () => {
const
sm
=
useMediaQuery
(
"sm"
);
const
currentUser
=
useCurrentUser
();
const
navigateTo
=
useNavigateTo
();
const
{
profile
}
=
useInstance
();
const
{
removeFilter
}
=
useMemoFilterContext
();
const
pathname
=
useMemo
(()
=>
location
.
pathname
,
[
location
.
pathname
]);
const
prevPathname
=
usePrevious
(
pathname
);
...
...
@@ -51,6 +72,7 @@ const RootLayout = () => {
</
div
>
)
}
<
main
className=
"w-full h-auto grow shrink flex flex-col justify-start items-center"
>
{
profile
.
demo
&&
<
DemoBanner
/>
}
<
Outlet
/>
</
main
>
</
div
>
...
...
web/src/locales/en.json
View file @
35504cc8
...
...
@@ -16,6 +16,11 @@
"sign-in-tip"
:
"Already have an account?"
,
"sign-up-tip"
:
"Don't have an account yet?"
},
"demo"
:
{
"banner-description"
:
"Changes are temporary and may be reset."
,
"banner-title"
:
"Memos demo"
,
"deploy-link"
:
"Deploy your Memos"
},
"attachment-library"
:
{
"actions"
:
{
"open"
:
"Open"
,
...
...
web/src/locales/zh-Hans.json
View file @
35504cc8
...
...
@@ -15,6 +15,11 @@
"sign-in-tip"
:
"已有账户?"
,
"sign-up-tip"
:
"还没有账户?"
},
"demo"
:
{
"banner-description"
:
"这里的改动是临时的,可能会被重置。"
,
"banner-title"
:
"Memos 演示站"
,
"deploy-link"
:
"部署你的 Memos"
},
"common"
:
{
"about"
:
"关于"
,
"add"
:
"增加"
,
...
...
web/src/locales/zh-Hant.json
View file @
35504cc8
...
...
@@ -15,6 +15,10 @@
"sign-in-tip"
:
"已經有帳戶了嗎?"
,
"sign-up-tip"
:
"還沒有帳戶嗎?"
},
"demo"
:
{
"banner-description"
:
"這裡的改動是暫時的,可能會被重置。"
,
"banner-title"
:
"Memos 演示站"
},
"common"
:
{
"about"
:
"關於"
,
"add"
:
"新增"
,
...
...
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