Skip to content
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

feat: install sharp and use keyof icons from lucide for icon #20

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Markdown from 'react-markdown'
import BlurFade from '@/components/magicui/blur-fade'
import BlurFadeText from '@/components/magicui/blur-fade-text'
import { ProjectCard } from '@/components/project-card'
import { Badge } from '@/components/ui/badge'

import { DATA } from '@/data/resume'

Expand Down
Binary file modified bun.lockb
Binary file not shown.
13 changes: 11 additions & 2 deletions components/project-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Image from 'next/image'
import Link from 'next/link'
import Markdown from 'react-markdown'
import { icons } from 'lucide-react'

import { Badge } from '@/components/ui/badge'
import {
Expand All @@ -10,6 +11,7 @@ import {
CardHeader,
CardTitle,
} from '@/components/ui/card'
import { Icon } from '@/components/ui/icon'

import { cn } from '@/lib/utils'

Expand Down Expand Up @@ -105,8 +107,15 @@ export function ProjectCard({
<div className="flex flex-row flex-wrap items-start gap-1">
{links?.map((link, idx) => (
<Link href={link?.href} key={idx} target="_blank">
<Badge key={idx} className="flex gap-2 px-2 py-1 text-[10px]">
{link.icon}
<Badge
key={idx}
className="flex items-center gap-2 px-2 py-1 text-[10px]"
>
<Icon
name={link.icon as keyof typeof icons}
size={14}
color="hsl(var(--secondary))"
/>
{link.type}
</Badge>
</Link>
Expand Down
17 changes: 17 additions & 0 deletions components/ui/icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { icons } from 'lucide-react'

export const Icon = ({
name,
color,
size,
className,
}: {
name: keyof typeof icons
color: string
size: number
className?: string
}) => {
const LucideIcon = icons[name as keyof typeof icons]

return <LucideIcon color={color} size={size} className={className} />
}
8 changes: 4 additions & 4 deletions data/resume.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const DATA = {
{
type: 'Source',
href: 'https://github.com/kinotio/gelda',
icon: <Icons.github className="size-3" />,
icon: 'Github',
},
],
image: '/gelda.png',
Expand All @@ -96,7 +96,7 @@ export const DATA = {
{
type: 'Source',
href: 'https://github.com/kinotio/drowser-studio',
icon: <Icons.github className="size-3" />,
icon: 'Github',
},
],
image: '/drowser-studio.png',
Expand All @@ -114,7 +114,7 @@ export const DATA = {
{
type: 'Source',
href: 'https://github.com/andostronaut/drowser',
icon: <Icons.github className="size-3" />,
icon: 'Github',
},
],
image: '/drowser.png',
Expand All @@ -132,7 +132,7 @@ export const DATA = {
{
type: 'Source',
href: 'https://github.com/andostronaut/cocli',
icon: <Icons.github className="size-3" />,
icon: 'Github',
},
],
image: '/cocli.gif',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"rehype-stringify": "^10.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0",
"sharp": "^0.33.4",
"shiki": "^1.7.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
Expand Down
Loading