From 1c38710308e9a105d1bdbc97dc83fa5c850ad972 Mon Sep 17 00:00:00 2001 From: Gri-ffin Date: Tue, 2 Jan 2024 14:05:52 +0100 Subject: [PATCH 1/3] add social media links --- web/containers/Layout/Ribbon/index.tsx | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/web/containers/Layout/Ribbon/index.tsx b/web/containers/Layout/Ribbon/index.tsx index fa6d53193..1a63b1d44 100644 --- a/web/containers/Layout/Ribbon/index.tsx +++ b/web/containers/Layout/Ribbon/index.tsx @@ -11,6 +11,8 @@ import { SettingsIcon, MonitorIcon, LayoutGridIcon, + Twitter, + Github, } from 'lucide-react' import { twMerge } from 'tailwind-merge' @@ -52,6 +54,23 @@ export default function RibbonNav() { }, ] + const linksMenu = [ + { + name: 'Twitter', + icon: ( + + ), + link: 'https://twitter.com/janhq', + }, + { + name: 'Github', + icon: ( + + ), + link: 'https://github.com/janhq/jan', + }, + ] + const secondaryMenus = [ { name: 'System Monitor', @@ -118,6 +137,32 @@ export default function RibbonNav() {
+ <> + {linksMenu + .filter((link) => !!link) + .map((link, i) => { + return ( +
+ + + + {link.icon} + + + + {link.name} + + + +
+ ) + })} + {secondaryMenus .filter((secondary) => !!secondary) .map((secondary, i) => { From d20810e67834be6b6a79fd96cc0495f4e1e2321a Mon Sep 17 00:00:00 2001 From: Gri-ffin Date: Tue, 2 Jan 2024 14:06:18 +0100 Subject: [PATCH 2/3] open social media in default browser instead of electron window --- electron/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/electron/main.ts b/electron/main.ts index 4ddf4df56..257842cf5 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -68,6 +68,12 @@ function createMainWindow() { if (process.platform !== 'darwin') app.quit() }) + /* Open external links in the default browser */ + mainWindow.webContents.setWindowOpenHandler(({ url }) => { + require('electron').shell.openExternal(url) + return { action: 'deny' } + }) + /* Enable dev tools for development */ if (!app.isPackaged) mainWindow.webContents.openDevTools() } From 868be419283fc074f58733c8d6541abc7162e18e Mon Sep 17 00:00:00 2001 From: 0xSage <69952136+0xSage@users.noreply.github.com> Date: Wed, 3 Jan 2024 12:32:45 +0800 Subject: [PATCH 3/3] fix: Jan twitter url --- web/containers/Layout/Ribbon/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/containers/Layout/Ribbon/index.tsx b/web/containers/Layout/Ribbon/index.tsx index 1a63b1d44..6a0146e64 100644 --- a/web/containers/Layout/Ribbon/index.tsx +++ b/web/containers/Layout/Ribbon/index.tsx @@ -60,7 +60,7 @@ export default function RibbonNav() { icon: ( ), - link: 'https://twitter.com/janhq', + link: 'https://twitter.com/janhq_', }, { name: 'Github',