Skip to content

Build your personal knowledge base with Trilium Notes

feat(about): handle standalone mode

Elian Doran75d2b8313b31
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index fd52fed8a4..67e54d7f67 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -13,6 +13,10 @@
"original-dev": "On 25th December 2017, Zadam released the first beta of Trilium (written with a single \"l\", unlike the flower). Dissatisfied with existing note organizers, he built a powerful self-hosted hierarchical knowledge base that gathered over 22,000 GitHub stars. In 2024, as life got busier, he placed the project into maintenance mode."
},
"contributor_full_list": "See the entire community",
+ "channel": {
+ "nightly": "Nightly",
+ "standalone": "Standalone"
+ },
"data_directory": "Data directory:",
"github_tooltip": "Report bugs, suggest features, or contribute on GitHub",
"license_tooltip": "View license",
diff --git a/apps/client/src/widgets/dialogs/about.css b/apps/client/src/widgets/dialogs/about.css
index 1a0d7e8c91..ddc8e7d312 100644
--- a/apps/client/src/widgets/dialogs/about.css
+++ b/apps/client/src/widgets/dialogs/about.css
@@ -3,7 +3,11 @@
--donate-button-color: #e33f3b;
&.nightly {
- --modal-background-color: #f6eefd ;
+ --modal-background-color: #f6eefd;
+ }
+
+ &.standalone {
+ --modal-background-color: #eef4fd;
}
}
@@ -13,6 +17,10 @@
&.nightly {
--modal-background-color: #23182b;
}
+
+ &.standalone {
+ --modal-background-color: #182230;
+ }
}
--bs-modal-width: 680px;
diff --git a/apps/client/src/widgets/dialogs/about.tsx b/apps/client/src/widgets/dialogs/about.tsx
index 0468f2ca44..f9591a5999 100644
--- a/apps/client/src/widgets/dialogs/about.tsx
+++ b/apps/client/src/widgets/dialogs/about.tsx
@@ -13,7 +13,7 @@ import contributors from "../../../../../contributors.json";
import { t } from "../../services/i18n.js";
import openService from "../../services/open.js";
import server from "../../services/server.js";
-import utils from "../../services/utils.js";
+import utils, { isStandalone } from "../../services/utils.js";
import { formatDateTime } from "../../utils/formatters.js";
import { useTooltip, useTriliumEvent } from "../react/hooks.jsx";
import Modal from "../react/Modal.js";
@@ -22,8 +22,8 @@ import { PropertySheet, PropertySheetItem } from "../react/PropertySheet.js";
export default function AboutDialog() {
const [appInfo, setAppInfo] = useState<AppInfo | null>(null);
const [isShown, setIsShown] = useState(false);
- const [isNightly, setNightly] = useState(false);
- const [icon, setIcon] = useState("default");
+ const [channel, setChannel] = useState<"stable" | "nightly" | "standalone">(isStandalone ? "standalone" : "stable");
+ const [icon, setIcon] = useState(isStandalone ? "nightly" : "default");
const [altIcon, setAltIcon] = useState<string | null>(null);
const hasLoaded = useRef(false);
@@ -32,7 +32,7 @@ export default function AboutDialog() {
if (!hasLoaded.current) {
const info = await server.get<AppInfo>("app-info");
if (info.appVersion.includes("test")) {
- setNightly(true);
+ setChannel("nightly");
setIcon("nightly");
}
setAppInfo(info);
@@ -72,7 +72,7 @@ export default function AboutDialog() {
return (
<Modal
- className={clsx(["about-dialog", {"nightly": isNightly}])}
+ className={clsx(["about-dialog", channel])}
size="md"
isFullPageOnMobile
show={isShown}
@@ -81,7 +81,7 @@ export default function AboutDialog() {
<div className="about-dialog-content">
<div className={"icon"} data-icon={altIcon ?? icon} />
- <h2>Trilium Notes {isNightly && <span className="channel-name">Nightly</span>}</h2>
+ <h2>Trilium Notes {channel !== "stable" && <span className="channel-name">{t(`about.channel.${channel}`)}</span>}</h2>
<a className="tn-link" href="https://triliumnotes.org/" target="_blank" rel="noopener noreferrer">
triliumnotes.org
</a>