Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: use mongraph host from core (instead of a static value)

Abdullah Atta7bf8f1cfc1d8
diff --git a/apps/web/src/components/note/index.tsx b/apps/web/src/components/note/index.tsx
index 135c54fde..674d09a6c 100644
--- a/apps/web/src/components/note/index.tsx
+++ b/apps/web/src/components/note/index.tsx
@@ -28,6 +28,7 @@ import {
Notebook as NotebookItem,
Tag,
createInternalLink,
+ hosts,
isReminderActive,
isReminderToday
} from "@notesnook/core";
@@ -436,7 +437,7 @@ const menuItems: (
title: strings.open(),
icon: OpenInNew.path,
onClick: async () => {
- const url = `https://monogr.ph/${note.id}`;
+ const url = `${hosts.MONOGRAPH_HOST}/${note.id}`;
window.open(url, "_blank");
}
},
@@ -446,7 +447,7 @@ const menuItems: (
title: strings.copyLink(),
icon: Copy.path,
onClick: async () => {
- const url = `https://monogr.ph/${note.id}`;
+ const url = `${hosts.MONOGRAPH_HOST}/${note.id}`;
await writeToClipboard({
"text/plain": url,
"text/html": `<a href="${url}">${note.title}</a>`,
diff --git a/apps/web/src/components/publish-view/index.tsx b/apps/web/src/components/publish-view/index.tsx
index faa19cf3d..2f68e90b4 100644
--- a/apps/web/src/components/publish-view/index.tsx
+++ b/apps/web/src/components/publish-view/index.tsx
@@ -27,7 +27,7 @@ import { db } from "../../common/db";
import { writeText } from "clipboard-polyfill";
import { ScopedThemeProvider } from "../theme-provider";
import { showToast } from "../../utils/toast";
-import { EV, EVENTS } from "@notesnook/core";
+import { EV, EVENTS, hosts } from "@notesnook/core";
import { useStore } from "../../stores/monograph-store";
import ReactModal from "react-modal";
import { DialogButton } from "../dialog";
@@ -131,7 +131,7 @@ function PublishView(props: PublishViewProps) {
variant="text.body"
as="a"
target="_blank"
- href={`https://monogr.ph/${publishId}`}
+ href={`${hosts.MONOGRAPH_HOST}/${publishId}`}
sx={{
textOverflow: "ellipsis",
whiteSpace: "nowrap",
@@ -140,13 +140,13 @@ function PublishView(props: PublishViewProps) {
mr: 2
}}
>
- {`https://monogr.ph/${publishId}`}
+ {`${hosts.MONOGRAPH_HOST}/${publishId}`}
</Link>
<Button
variant="anchor"
className="copyPublishLink"
onClick={() => {
- writeText(`https://monogr.ph/${publishId}`);
+ writeText(`${hosts.MONOGRAPH_HOST}/${publishId}`);
}}
>
<Copy size={20} color="accent" />