- Notifications
You must be signed in to change notification settings - Fork 0
feat: add devicon icons to tag badges#25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
37e6fc341bc015fe0ba82cfa1a09e38e66c5de552fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -27,6 +27,12 @@ export default function RootLayout({ | ||
| className={`${inter.variable} ${spaceGrotesk.variable} ${jetbrainsMono.variable} h-full`} | ||
| suppressHydrationWarning | ||
| > | ||
| <head> | ||
| <link | ||
| rel="stylesheet" | ||
| href="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/devicon.min.css" | ||
| /> | ||
| </head> | ||
michellepace marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| <body className="flex min-h-full flex-col antialiased"> | ||
| <ThemeProvider | ||
| attribute="class" | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { Tag } from "lucide-react"; | ||
| import Link from "next/link"; | ||
| import { Badge } from "@/components/ui/badge"; | ||
| import { getDeviconClassName } from "@/lib/devicon"; | ||
| type TagLinkProps = { | ||
| name: string; | ||
| questionCount?: number; | ||
| colored?: boolean; | ||
| showIcon?: boolean; | ||
| }; | ||
| export function TagLink({ | ||
| name, | ||
| questionCount, | ||
| colored = false, | ||
| showIcon = false, | ||
| }: TagLinkProps) { | ||
| const iconClass = getDeviconClassName(name, colored); | ||
| return ( | ||
| <Link | ||
| href={`/tags/${name}`} | ||
| className="group flex items-center justify-between gap-2 rounded-md p-1 transition-transform duration-150 hover:-translate-y-0.5 hover:scale-[1.005]" | ||
| > | ||
| <Badge className="flex items-center gap-1.5 rounded-md border-transparent bg-(--tag-bg) px-4 py-1.5 uppercase text-(--tag-text)"> | ||
| {showIcon && | ||
| (iconClass ? ( | ||
| <i className={iconClass} aria-hidden="true" /> | ||
| ) : ( | ||
| <Tag className="size-3.5" aria-hidden="true" /> | ||
| ))} | ||
| {name} | ||
| </Badge> | ||
| {questionCount !== undefined && ( | ||
| <span className="text-xs text-muted-foreground">{questionCount}</span> | ||
| )} | ||
| </Link> | ||
| ); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.