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: add no data tip

Steven77178afad58c
diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx
index 747450642..3a5987757 100644
--- a/web/src/pages/Explore.tsx
+++ b/web/src/pages/Explore.tsx
@@ -78,22 +78,26 @@ const Explore = () => {
</div>
<Only when={!loadingState.isLoading}>
<main className="memos-wrapper">
- {state.memos.map((memo) => {
- const createdAtStr = dayjs(memo.createdTs).locale(locale).format("YYYY/MM/DD HH:mm:ss");
- return (
- <div className="memo-container" key={memo.id}>
- <div className="memo-header">
- <span className="time-text">{createdAtStr}</span>
- <span className="split-text">by</span>
- <a className="name-text" href={`/u/${memo.creator.id}`}>
- {memo.creator.name}
- </a>
+ {state.memos.length > 0 ? (
+ state.memos.map((memo) => {
+ const createdAtStr = dayjs(memo.createdTs).locale(locale).format("YYYY/MM/DD HH:mm:ss");
+ return (
+ <div className="memo-container" key={memo.id}>
+ <div className="memo-header">
+ <span className="time-text">{createdAtStr}</span>
+ <span className="split-text">by</span>
+ <a className="name-text" href={`/u/${memo.creator.id}`}>
+ {memo.creator.name}
+ </a>
+ </div>
+ <MemoContent className="memo-content" content={memo.content} onMemoContentClick={() => undefined} />
+ <MemoResources memo={memo} />
</div>
- <MemoContent className="memo-content" content={memo.content} onMemoContentClick={() => undefined} />
- <MemoResources memo={memo} />
- </div>
- );
- })}
+ );
+ })
+ ) : (
+ <p className="w-full text-center mt-12 text-gray-600">{t("message.no-memos")}</p>
+ )}
</main>
</Only>
</div>