Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: update tag selector

boojacke51046581801
diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsx
index b9f747974..e5fd5cf78 100644
--- a/web/src/components/MemoEditor.tsx
+++ b/web/src/components/MemoEditor.tsx
@@ -254,7 +254,7 @@ const MemoEditor: React.FC<Props> = () => {
const handleTagSeletorClick = useCallback((event: React.MouseEvent) => {
if (tagSeletorRef.current !== event.target && tagSeletorRef.current?.contains(event.target as Node)) {
- editorRef.current?.insertText((event.target as HTMLElement).textContent ?? "");
+ editorRef.current?.insertText((event.target as HTMLElement).textContent + " " ?? "");
toggleTagSeletor(false);
}
}, []);
diff --git a/web/src/components/TagList.tsx b/web/src/components/TagList.tsx
index d2501ae5b..4fc2818c1 100644
--- a/web/src/components/TagList.tsx
+++ b/web/src/components/TagList.tsx
@@ -77,7 +77,7 @@ const TagList: React.FC<Props> = () => {
))}
<Only when={tags.length < 5 && memoService.initialized}>
<p className="tag-tip-container">
- Enter <span className="code-text"># Tag </span> to create a tag
+ Enter <span className="code-text">#Tag </span> to create a tag
</p>
</Only>
</div>
diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsx
index 95b18d10c..2fb5d5b31 100644
--- a/web/src/components/UserBanner.tsx
+++ b/web/src/components/UserBanner.tsx
@@ -28,9 +28,10 @@ const UserBanner: React.FC<Props> = () => {
return (
<div className="user-banner-container">
- <p className="username-text" onClick={handleUsernameClick}>
- {username}
- </p>
+ <div className="username-container" onClick={handleUsernameClick}>
+ <span className="username-text">{username}</span>
+ {user?.role === "OWNER" ? <span className="tag">MOD</span> : null}
+ </div>
<span className="action-btn menu-popup-btn" onClick={handlePopupBtnClick}>
<img src="/icons/more.svg" className="icon-img" />
</span>
diff --git a/web/src/less/user-banner.less b/web/src/less/user-banner.less
index 383c01d6c..c0ce978e2 100644
--- a/web/src/less/user-banner.less
+++ b/web/src/less/user-banner.less
@@ -4,8 +4,16 @@
.flex(row, space-between, center);
@apply w-full h-auto px-6 flex-nowrap mb-1;
- > .username-text {
- @apply font-bold text-lg pr-2 text-slate-800 cursor-pointer shrink truncate;
+ > .username-container {
+ @apply shrink flex flex-row justify-start items-center flex-nowrap truncate;
+
+ > .username-text {
+ @apply font-bold text-lg pr-1 text-slate-800 cursor-pointer shrink truncate;
+ }
+
+ > .tag {
+ @apply text-xs px-1 bg-blue-500 rounded text-white;
+ }
}
> .action-btn {