Skip to content

Commit

Permalink
Merge pull request janhq#1295 from Gri-ffin/bring-socialmedia-links
Browse files Browse the repository at this point in the history
Bring social media links
  • Loading branch information
freelerobot authored Jan 3, 2024
2 parents 7920069 + 868be41 commit 56f64b6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
45 changes: 45 additions & 0 deletions web/containers/Layout/Ribbon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
SettingsIcon,
MonitorIcon,
LayoutGridIcon,
Twitter,
Github,
} from 'lucide-react'

import { twMerge } from 'tailwind-merge'
Expand Down Expand Up @@ -52,6 +54,23 @@ export default function RibbonNav() {
},
]

const linksMenu = [
{
name: 'Twitter',
icon: (
<Twitter size={20} className="flex-shrink-0 text-muted-foreground" />
),
link: 'https://twitter.com/janhq_',
},
{
name: 'Github',
icon: (
<Github size={20} className="flex-shrink-0 text-muted-foreground" />
),
link: 'https://github.com/janhq/jan',
},
]

const secondaryMenus = [
{
name: 'System Monitor',
Expand Down Expand Up @@ -118,6 +137,32 @@ export default function RibbonNav() {
</div>

<div>
<>
{linksMenu
.filter((link) => !!link)
.map((link, i) => {
return (
<div className="relative flex p-2" key={i}>
<Tooltip>
<TooltipTrigger>
<a
href={link.link}
target="_blank"
rel="noopener noreferrer"
className="relative flex w-full flex-shrink-0 cursor-pointer items-center justify-center"
>
{link.icon}
</a>
</TooltipTrigger>
<TooltipContent side="right" sideOffset={10}>
<span>{link.name}</span>
<TooltipArrow />
</TooltipContent>
</Tooltip>
</div>
)
})}
</>
{secondaryMenus
.filter((secondary) => !!secondary)
.map((secondary, i) => {
Expand Down

0 comments on commit 56f64b6

Please sign in to comment.