Skip to content

Commit fa2857d

Browse files
authored
Add CardMultipleIcons component for displaying multiple icons (#66)
* feat: add CardMultipleIcons component for displaying multiple icons * fix: correct border radius style in CardMultipleIcons component * feat: add SVG icons for Discord and Telegram in assets * refactor: biome
1 parent 615d1bd commit fa2857d

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

src/app/page.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import Image from "next/image"
2+
import { FiFacebook, FiGithub, FiInstagram, FiLinkedin } from "react-icons/fi"
3+
import discord from "@/assets/icons/discord.svg"
4+
import telegram from "@/assets/icons/telegram.svg"
5+
import { CardMultipleIcons } from "@/components/card-multiple-icons"
16
import { Hero } from "@/components/home/hero"
27
import { Materials } from "@/components/home/materials"
38

@@ -6,6 +11,18 @@ export default function Home() {
611
<main className="w-full">
712
<Hero />
813
<Materials />
14+
<div className="mx-auto w-fit py-12">
15+
<CardMultipleIcons
16+
icons={[
17+
<Image key="telegram" src={telegram} alt="Telegram" />,
18+
<FiInstagram key="instagram" />,
19+
<FiLinkedin key="linkedin" />,
20+
<FiFacebook key="facebook" />,
21+
<Image key="discord" src={discord} alt="Discord" />,
22+
<FiGithub key="github" />,
23+
]}
24+
/>
25+
</div>
926
</main>
1027
)
1128
}

src/assets/icons/discord.svg

Lines changed: 5 additions & 0 deletions
Loading

src/assets/icons/telegram.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as React from "react"
2+
import { Glass } from "@/components/glass"
3+
import { cn } from "@/lib/utils"
4+
import type { CardMultipleIconsProps } from "./types"
5+
6+
export function CardMultipleIcons({ icons, className }: CardMultipleIconsProps) {
7+
const iconItems = React.Children.toArray(icons)
8+
9+
return (
10+
<Glass
11+
className={cn(
12+
"inline-flex max-w-full overflow-hidden rounded-full border-white/50 bg-background-blur p-0 text-card-foreground",
13+
className
14+
)}
15+
>
16+
<div className="flex flex-wrap items-center gap-6 px-6 py-3">
17+
{iconItems.map((icon) => (
18+
<span
19+
key={typeof icon === "object" && icon !== null && "key" in icon ? icon.key : undefined}
20+
className="flex shrink-0 items-center justify-center text-2xl text-text-primary"
21+
>
22+
{icon}
23+
</span>
24+
))}
25+
</div>
26+
</Glass>
27+
)
28+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type * as React from "react"
2+
3+
export type CardMultipleIconsProps = {
4+
icons: React.ReactNode[]
5+
className?: string
6+
}

0 commit comments

Comments
 (0)