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.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore: update button entries (#206)
boojackb0b2776d0350
diff --git a/web/src/components/MenuBtnsPopup.tsx b/web/src/components/MenuBtnsPopup.tsxindex 75176a83a..50a76c22a 100644--- a/web/src/components/MenuBtnsPopup.tsx+++ b/web/src/components/MenuBtnsPopup.tsx@@ -1,10 +1,10 @@import { useEffect, useRef } from "react";-import * as api from "../helpers/api";import { locationService, userService } from "../services";import useI18n from "../hooks/useI18n";-import toastHelper from "./Toast";import Only from "./common/OnlyWhen";import showAboutSiteDialog from "./AboutSiteDialog";+import showArchivedMemoDialog from "./ArchivedMemoDialog";+import showResourcesDialog from "./ResourcesDialog";import "../less/menu-btns-popup.less";interface Props {@@ -32,27 +32,16 @@ const MenuBtnsPopup: React.FC<Props> = (props: Props) => {}}, [shownStatus]);- const handlePingBtnClick = () => {- api- .getSystemStatus()- .then(({ data }) => {- const {- data: { profile },- } = data;- toastHelper.info(JSON.stringify(profile, null, 4));- })- .catch((error) => {- console.error(error);- toastHelper.error(error.response.data.message);- });+ const handleResourcesBtnClick = () => {+ showResourcesDialog();};- const handleAboutBtnClick = () => {- showAboutSiteDialog();+ const handleArchivedBtnClick = () => {+ showArchivedMemoDialog();};- const handleExploreBtnClick = () => {- locationService.pushHistory("/explore");+ const handleAboutBtnClick = () => {+ showAboutSiteDialog();};const handleSignOutBtnClick = async () => {@@ -69,12 +58,14 @@ const MenuBtnsPopup: React.FC<Props> = (props: Props) => {return (<div className={`menu-btns-popup ${shownStatus ? "" : "hidden"}`} ref={popupElRef}>- <button className="btn action-btn" onClick={handleExploreBtnClick}>- <span className="icon">๐พ</span> Explore- </button>- <button className="btn action-btn" onClick={handlePingBtnClick}>- <span className="icon">๐ฏ</span> Ping- </button>+ <Only when={!userService.isVisitorMode()}>+ <button className="btn action-btn" onClick={handleResourcesBtnClick}>+ <span className="icon">๐</span> {t("sidebar.resources")}+ </button>+ <button className="btn action-btn" onClick={handleArchivedBtnClick}>+ <span className="icon">๐</span> {t("sidebar.archived")}+ </button>+ </Only><button className="btn action-btn" onClick={handleAboutBtnClick}><span className="icon">๐ค </span> {t("common.about")}</button>diff --git a/web/src/components/Sidebar.tsx b/web/src/components/Sidebar.tsxindex 6d563891f..38c02b296 100644--- a/web/src/components/Sidebar.tsx+++ b/web/src/components/Sidebar.tsx@@ -1,11 +1,9 @@-import { userService } from "../services";+import { locationService, userService } from "../services";import useI18n from "../hooks/useI18n";import Icon from "./Icon";import Only from "./common/OnlyWhen";import showDailyReviewDialog from "./DailyReviewDialog";import showSettingDialog from "./SettingDialog";-import showArchivedMemoDialog from "./ArchivedMemoDialog";-import showResourcesDialog from "./ResourcesDialog";import UserBanner from "./UserBanner";import UsageHeatMap from "./UsageHeatMap";import ShortcutList from "./ShortcutList";@@ -15,14 +13,12 @@ import "../less/siderbar.less";const Sidebar = () => {const { t } = useI18n();- const handleMyAccountBtnClick = () => {+ const handleSettingBtnClick = () => {showSettingDialog();};- const handleResourcesBtnClick = () => {- showResourcesDialog();- };- const handleArchivedBtnClick = () => {- showArchivedMemoDialog();++ const handleExploreBtnClick = () => {+ locationService.pushHistory("/explore");};return (@@ -39,14 +35,11 @@ const Sidebar = () => {<span className="icon">๐ </span> {t("sidebar.daily-review")}</button><Only when={!userService.isVisitorMode()}>- <button className="btn action-btn" onClick={handleResourcesBtnClick}>- <span className="icon">๐</span> {t("sidebar.resources")}- </button>- <button className="btn action-btn" onClick={handleMyAccountBtnClick}>+ <button className="btn action-btn" onClick={handleSettingBtnClick}><span className="icon">โ๏ธ</span> {t("sidebar.setting")}</button>- <button className="btn action-btn" onClick={handleArchivedBtnClick}>- <span className="icon">๐</span> {t("sidebar.archived")}+ <button className="btn action-btn" onClick={() => handleExploreBtnClick()}>+ <span className="icon">๐</span> {t("common.explore")}</button></Only></div>diff --git a/web/src/less/explore.less b/web/src/less/explore.lessindex 27c09d85a..2e911a142 100644--- a/web/src/less/explore.less+++ b/web/src/less/explore.less@@ -8,10 +8,20 @@@apply relative w-full min-h-screen mx-auto flex flex-col justify-start items-center;> .page-header {- @apply relative max-w-2xl w-full min-h-full flex flex-row justify-start items-center px-4 sm:pr-6;+ @apply relative max-w-2xl w-full min-h-full flex flex-row justify-between items-center px-4 sm:pr-6 mt-6 mb-2;> .logo-img {- @apply h-14 w-auto mt-6 mb-2;+ @apply h-14 w-auto;+ }++ > .action-button-container {+ > .btn {+ @apply text-blue-600 py-1 hover:opacity-80;++ > .icon {+ @apply text-lg mr-1;+ }+ }}}@@ -42,17 +52,5 @@}}}-- > .addtion-btn-container {- @apply fixed bottom-12 left-1/2 -translate-x-1/2;-- > .btn {- @apply bg-blue-600 text-white px-4 py-2 rounded-3xl shadow-2xl hover:opacity-80;-- > .icon {- @apply text-lg mr-1;- }- }- }}}diff --git a/web/src/locales/en.json b/web/src/locales/en.jsonindex 31690adbb..262d33107 100644--- a/web/src/locales/en.json+++ b/web/src/locales/en.json@@ -22,6 +22,7 @@"archive": "Archive","basic": "Basic","admin": "Admin",+ "explore": "Explore","sign-in": "Sign in","sign-out": "Sign out","back-to-home": "Back to Home"diff --git a/web/src/locales/zh.json b/web/src/locales/zh.jsonindex 019d9734f..660b584c8 100644--- a/web/src/locales/zh.json+++ b/web/src/locales/zh.json@@ -22,6 +22,7 @@"archive": "ๅฝๆกฃ","basic": "ๅบ็ก","admin": "็ฎก็ๅ",+ "explore": "ๆข็ดข","sign-in": "็ปๅฝ","sign-out": "้ๅบ็ปๅฝ","back-to-home": "ๅๅฐไธป้กต"diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsxindex 76b81c7d7..6c25b124a 100644--- a/web/src/pages/Explore.tsx+++ b/web/src/pages/Explore.tsx@@ -47,6 +47,17 @@ const Explore = () => {<div className="page-container"><div className="page-header"><img className="logo-img" src="/logo-full.webp" alt="" />+ <div className="action-button-container">+ {user ? (+ <button className="btn" onClick={() => (window.location.href = "/")}>+ <span className="icon">๐ </span> {t("common.back-to-home")}+ </button>+ ) : (+ <button className="btn" onClick={() => (window.location.href = "/auth")}>+ <span className="icon">๐</span> {t("common.sign-in")}+ </button>+ )}+ </div></div><main className="memos-wrapper">{state.memos.map((memo) => {@@ -65,18 +76,6 @@ const Explore = () => {);})}</main>-- <div className="addtion-btn-container">- {user ? (- <button className="btn" onClick={() => (window.location.href = "/")}>- <span className="icon">๐ </span> {t("common.back-to-home")}- </button>- ) : (- <button className="btn" onClick={() => (window.location.href = "/auth")}>- <span className="icon">๐</span> {t("common.sign-in")}- </button>- )}- </div></div>)}</section>