feat: add "Join Discord" menu item and link in AboutDialog
This commit is contained in:
@@ -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";
|
const MENU_ITEM_REPORT_BUG_ID: &str = "openchamber_report_bug";
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
const MENU_ITEM_REQUEST_FEATURE_ID: &str = "openchamber_request_feature";
|
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
|
// App menu
|
||||||
#[cfg(target_os = "macos")]
|
#[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_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 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)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct DesktopRuntime {
|
pub(crate) struct DesktopRuntime {
|
||||||
@@ -493,6 +496,14 @@ fn build_macos_menu<R: tauri::Runtime>(app: &tauri::AppHandle<R>) -> tauri::Resu
|
|||||||
None::<&str>,
|
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(
|
let theme_submenu = Submenu::with_items(
|
||||||
app,
|
app,
|
||||||
"Theme",
|
"Theme",
|
||||||
@@ -524,6 +535,8 @@ fn build_macos_menu<R: tauri::Runtime>(app: &tauri::AppHandle<R>) -> tauri::Resu
|
|||||||
&PredefinedMenuItem::separator(app)?,
|
&PredefinedMenuItem::separator(app)?,
|
||||||
&report_bug,
|
&report_bug,
|
||||||
&request_feature,
|
&request_feature,
|
||||||
|
&PredefinedMenuItem::separator(app)?,
|
||||||
|
&join_discord,
|
||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -873,6 +886,15 @@ fn main() {
|
|||||||
return;
|
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
|
// App menu actions
|
||||||
if event_id == MENU_ITEM_ABOUT_ID {
|
if event_id == MENU_ITEM_ABOUT_ID {
|
||||||
let _ = app.emit("openchamber:menu-action", "about");
|
let _ = app.emit("openchamber:menu-action", "about");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
DialogContent,
|
DialogContent,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { OpenChamberLogo } from '@/components/ui/OpenChamberLogo';
|
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;
|
declare const __APP_VERSION__: string | undefined;
|
||||||
|
|
||||||
@@ -80,6 +80,15 @@ export const AboutDialog: React.FC<AboutDialogProps> = ({
|
|||||||
<RiGithubFill className="h-4 w-4" />
|
<RiGithubFill className="h-4 w-4" />
|
||||||
<span>GitHub</span>
|
<span>GitHub</span>
|
||||||
</a>
|
</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
|
<a
|
||||||
href="https://x.com/btriapitsyn"
|
href="https://x.com/btriapitsyn"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/btriapitsyn/openchamber.git"
|
"url": "https://github.com/btriapitsyn/openchamber.git"
|
||||||
},
|
},
|
||||||
|
"qna": "https://discord.gg/ZYRSdnwwKA",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.85.0"
|
"vscode": "^1.85.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user