diff --git a/web/src/App.tsx b/web/src/App.tsx index 1ce37104..ac216f47 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -12,8 +12,8 @@ import { useUserV1Store } from "./store/v1"; const App = () => { const { i18n } = useTranslation(); const navigateTo = useNavigateTo(); - const globalStore = useGlobalStore(); const { mode, setMode } = useColorScheme(); + const globalStore = useGlobalStore(); const userV1Store = useUserV1Store(); const [loading, setLoading] = useState(true); const { appearance, locale, systemStatus } = globalStore.state; @@ -30,7 +30,7 @@ const App = () => { try { await userV1Store.fetchCurrentUser(); } catch (error) { - // Skip. + // Do nothing. } setLoading(false); }; @@ -75,8 +75,8 @@ const App = () => { } }, [systemStatus.additionalScript]); + // Dynamic update metadata with customized profile. useEffect(() => { - // dynamic update metadata with customized profile. document.title = systemStatus.customizedProfile.name; const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement; link.href = systemStatus.customizedProfile.logoUrl || "/logo.png"; diff --git a/web/src/components/EmbedMemoDialog.tsx b/web/src/components/EmbedMemoDialog.tsx deleted file mode 100644 index 393685dc..00000000 --- a/web/src/components/EmbedMemoDialog.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import copy from "copy-to-clipboard"; -import React from "react"; -import { toast } from "react-hot-toast"; -import { useTranslate } from "@/utils/i18n"; -import { generateDialog } from "./Dialog"; -import Icon from "./Icon"; - -interface Props extends DialogProps { - memoId: MemoId; -} - -const EmbedMemoDialog: React.FC = (props: Props) => { - const t = useTranslate(); - const { memoId, destroy } = props; - - const memoEmbeddedCode = () => { - return ``; - }; - - const handleCopyCode = () => { - copy(memoEmbeddedCode()); - toast.success("Succeed to copy code to clipboard."); - }; - - return ( - <> -
-

{t("embed-memo.title")}

- -
-
-

{t("embed-memo.text")}

-
-          {memoEmbeddedCode()}
-        
-

- {t("embed-memo.only-public-supported")} - - {t("embed-memo.copy")} - -

-
- - ); -}; - -function showEmbedMemoDialog(memoId: MemoId) { - generateDialog( - { - className: "embed-memo-dialog", - dialogName: "embed-memo-dialog", - }, - EmbedMemoDialog, - { - memoId, - } - ); -} - -export default showEmbedMemoDialog; diff --git a/web/src/components/MobileHeader.tsx b/web/src/components/MobileHeader.tsx index 3d9ffcb8..7c0688a3 100644 --- a/web/src/components/MobileHeader.tsx +++ b/web/src/components/MobileHeader.tsx @@ -12,7 +12,7 @@ const MobileHeader = (props: Props) => { const [titleText] = useState("MEMOS"); return ( -
+
{!sm && } { id: "header-explore", path: "/explore", title: t("common.explore"), - icon: , + icon: , }; const archivedNavLink: NavLinkItem = { id: "header-archived", @@ -108,7 +108,7 @@ const Navigation = () => { id={navLink.id} className={({ isActive }) => classNames( - "px-4 pr-5 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-600 dark:hover:bg-zinc-700", + "w-full px-4 pr-5 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-600 dark:hover:bg-zinc-700", isActive ? "bg-white drop-shadow-sm dark:bg-zinc-700 border-gray-200 dark:border-zinc-600" : "border-transparent" ) } diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index dd0a319a..d9b88245 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -8,7 +8,6 @@ import toImage from "@/labs/html2image"; import { useUserV1Store, extractUsernameFromName } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; -import showEmbedMemoDialog from "./EmbedMemoDialog"; import Icon from "./Icon"; import MemoContentV1 from "./MemoContentV1"; import MemoResourceListView from "./MemoResourceListView"; @@ -65,10 +64,6 @@ const ShareMemoDialog: React.FC = (props: Props) => { }); }; - const handleShowEmbedMemoDialog = () => { - showEmbedMemoDialog(memo.id); - }; - const handleCopyLinkBtnClick = () => { copy(`${window.location.origin}/m/${memo.id}`); toast.success(t("message.succeed-copy-link")); @@ -96,10 +91,6 @@ const ShareMemoDialog: React.FC = (props: Props) => { )} {t("common.image")} -