Skip to content

Commit

Permalink
feat: external link
Browse files Browse the repository at this point in the history
  • Loading branch information
TinsFox committed Nov 2, 2024
1 parent e8f5d69 commit cc0f238
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/components/nav-sidebar/app-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { env } from "@env"
import {
Command,
LifeBuoy,
Send,
} from "lucide-react"
import * as React from "react"
Expand All @@ -22,15 +21,11 @@ import {
import { useNavMenu } from "@/hooks/query/user-memu"

const navSecondary = [
{
title: "Support",
url: "#",
icon: LifeBuoy,
},
{
title: "Feedback",
url: "https://github.com/TinsFox/shadcnui-boilerplate/issues",
icon: Send,
external: true,
},
]

Expand Down
8 changes: 5 additions & 3 deletions src/components/nav-sidebar/nav-secondary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { LucideIcon } from "lucide-react"
import * as React from "react"
import { Link } from "react-router-dom"

import {
SidebarGroup,
Expand All @@ -14,9 +15,10 @@ export function NavSecondary({
...props
}: {
items: {
title: string
title: I18nKeys
url: string
icon: LucideIcon
external?: boolean
}[]
} & React.ComponentPropsWithoutRef<typeof SidebarGroup>) {
return (
Expand All @@ -26,10 +28,10 @@ export function NavSecondary({
{items.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton asChild size="sm">
<a href={item.url}>
<Link to={item.url} target={item.external ? "_blank" : "_self"}>
<item.icon />
<span>{item.title}</span>
</a>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
))}
Expand Down

0 comments on commit cc0f238

Please sign in to comment.