Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(options/other): use toggles
Elian Doran0ead37fd5c93
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 38aeb63b24..41d22d962d 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -1315,7 +1315,8 @@},"network_connections": {"network_connections_title": "Network",- "check_for_updates": "Check for updates automatically"+ "check_for_updates": "Check for updates automatically",+ "check_for_updates_description": "Checks for new versions on GitHub and shows a notification in the global menu when available."},"note_erasure_timeout": {"note_erasure_timeout_title": "Deleted Notes",@@ -1998,7 +1999,7 @@"days": "Days"},"share": {- "title": "Share Settings",+ "title": "Share","redirect_bare_domain": "Redirect bare domain to Share page","redirect_bare_domain_description": "Redirect anonymous users to the Share page instead of showing Login","show_login_link": "Show Login link in Share theme",diff --git a/apps/client/src/widgets/type_widgets/options/other.tsx b/apps/client/src/widgets/type_widgets/options/other.tsxindex 2effd26f0a..9b96db4e09 100644--- a/apps/client/src/widgets/type_widgets/options/other.tsx+++ b/apps/client/src/widgets/type_widgets/options/other.tsx@@ -260,34 +260,35 @@ function ShareSettings() {return (<OptionsSection title={t("share.title")}>- <FormGroup name="redirectBareDomain" description={t("share.redirect_bare_domain_description")}>- <FormCheckbox- label={t(t("share.redirect_bare_domain"))}- currentValue={redirectBareDomain}- onChange={async value => {- if (value) {- const shareRootNotes = await search.searchForNotes("#shareRoot");- const sharedShareRootNote = shareRootNotes.find((note) => note.isShared());-- if (sharedShareRootNote) {- toast.showMessage(t("share.share_root_found", { noteTitle: sharedShareRootNote.title }));- } else if (shareRootNotes.length > 0) {- toast.showError(t("share.share_root_not_shared", { noteTitle: shareRootNotes[0].title }));- } else {- toast.showError(t("share.share_root_not_found"));- }+ <OptionsRowWithToggle+ name="redirect-bare-domain"+ label={t("share.redirect_bare_domain")}+ description={t("share.redirect_bare_domain_description")}+ currentValue={redirectBareDomain}+ onChange={async value => {+ if (value) {+ const shareRootNotes = await search.searchForNotes("#shareRoot");+ const sharedShareRootNote = shareRootNotes.find((note) => note.isShared());++ if (sharedShareRootNote) {+ toast.showMessage(t("share.share_root_found", { noteTitle: sharedShareRootNote.title }));+ } else if (shareRootNotes.length > 0) {+ toast.showError(t("share.share_root_not_shared", { noteTitle: shareRootNotes[0].title }));+ } else {+ toast.showError(t("share.share_root_not_found"));}- setRedirectBareDomain(value);- }}- />- </FormGroup>+ }+ setRedirectBareDomain(value);+ }}+ />- <FormGroup name="showLoginInShareTheme" description={t("share.show_login_link_description")}>- <FormCheckbox- label={t("share.show_login_link")}- currentValue={showLogInShareTheme} onChange={setShowLogInShareTheme}- />- </FormGroup>+ <OptionsRowWithToggle+ name="show-login-in-share-theme"+ label={t("share.show_login_link")}+ description={t("share.show_login_link_description")}+ currentValue={showLogInShareTheme}+ onChange={setShowLogInShareTheme}+ /></OptionsSection>);}@@ -297,10 +298,12 @@ function NetworkSettings() {return (<OptionsSection title={t("network_connections.network_connections_title")}>- <FormCheckbox+ <OptionsRowWithTogglename="check-for-updates"label={t("network_connections.check_for_updates")}- currentValue={checkForUpdates} onChange={setCheckForUpdates}+ description={t("network_connections.check_for_updates_description")}+ currentValue={checkForUpdates}+ onChange={setCheckForUpdates}/></OptionsSection>);