feat: add "Join Discord" menu item and link in AboutDialog

This commit is contained in:
Bohdan Triapitsyn
2025-12-26 03:23:58 +02:00
parent 70522901c2
commit c0c82663c0
3 changed files with 33 additions and 1 deletions
+22
View File
@@ -89,6 +89,8 @@ const MENU_ITEM_CHECK_FOR_UPDATES_ID: &str = "openchamber_check_for_updates";
const MENU_ITEM_REPORT_BUG_ID: &str = "openchamber_report_bug";
#[cfg(target_os = "macos")]
const MENU_ITEM_REQUEST_FEATURE_ID: &str = "openchamber_request_feature";
#[cfg(target_os = "macos")]
const MENU_ITEM_JOIN_DISCORD_ID: &str = "openchamber_join_discord";
// App menu
#[cfg(target_os = "macos")]
@@ -132,6 +134,7 @@ const MENU_ITEM_DOWNLOAD_LOGS_ID: &str = "openchamber_download_logs";
const GITHUB_BUG_REPORT_URL: &str = "https://github.com/btriapitsyn/openchamber/issues/new?template=bug_report.yml";
const GITHUB_FEATURE_REQUEST_URL: &str = "https://github.com/btriapitsyn/openchamber/issues/new?template=feature_request.yml";
const DISCORD_INVITE_URL: &str = "https://discord.gg/ZYRSdnwwKA";
#[derive(Clone)]
pub(crate) struct DesktopRuntime {
@@ -493,6 +496,14 @@ fn build_macos_menu<R: tauri::Runtime>(app: &tauri::AppHandle<R>) -> tauri::Resu
None::<&str>,
)?;
let join_discord = MenuItem::with_id(
app,
MENU_ITEM_JOIN_DISCORD_ID,
"Join Discord",
true,
None::<&str>,
)?;
let theme_submenu = Submenu::with_items(
app,
"Theme",
@@ -524,6 +535,8 @@ fn build_macos_menu<R: tauri::Runtime>(app: &tauri::AppHandle<R>) -> tauri::Resu
&PredefinedMenuItem::separator(app)?,
&report_bug,
&request_feature,
&PredefinedMenuItem::separator(app)?,
&join_discord,
],
)?;
@@ -873,6 +886,15 @@ fn main() {
return;
}
if event_id == MENU_ITEM_JOIN_DISCORD_ID {
use tauri_plugin_shell::ShellExt;
#[allow(deprecated)]
{
let _ = app.shell().open(DISCORD_INVITE_URL, None);
}
return;
}
// App menu actions
if event_id == MENU_ITEM_ABOUT_ID {
let _ = app.emit("openchamber:menu-action", "about");
+10 -1
View File
@@ -4,7 +4,7 @@ import {
DialogContent,
} from '@/components/ui/dialog';
import { OpenChamberLogo } from '@/components/ui/OpenChamberLogo';
import { RiGithubFill, RiTwitterXFill } from '@remixicon/react';
import { RiDiscordFill, RiGithubFill, RiTwitterXFill } from '@remixicon/react';
declare const __APP_VERSION__: string | undefined;
@@ -80,6 +80,15 @@ export const AboutDialog: React.FC<AboutDialogProps> = ({
<RiGithubFill className="h-4 w-4" />
<span>GitHub</span>
</a>
<a
href="https://discord.gg/ZYRSdnwwKA"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-1.5 typography-meta text-muted-foreground hover:text-foreground transition-colors"
>
<RiDiscordFill className="h-4 w-4" />
<span>Discord</span>
</a>
<a
href="https://x.com/btriapitsyn"
target="_blank"
+1
View File
@@ -9,6 +9,7 @@
"type": "git",
"url": "https://github.com/btriapitsyn/openchamber.git"
},
"qna": "https://discord.gg/ZYRSdnwwKA",
"license": "MIT",
"engines": {
"vscode": "^1.85.0"