Add tooltip support to project tags
This commit is contained in:
1 parent
f1cc0ac567
commit
1fabcf2eef
1 file changed
+10
-5
@@ -1,12 +1,14 @@
|
|||||||
---
|
---
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import Section from "./ui/Section.astro";
|
import Section from "./ui/Section.astro";
|
||||||
|
import Tooltip from "./ui/Tooltip.astro";
|
||||||
|
|
||||||
const { projects } = Astro.props;
|
const { projects } = Astro.props;
|
||||||
|
|
||||||
interface ProjectTag {
|
interface ProjectTag {
|
||||||
name: string;
|
name: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
tooltip?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProjectProps {
|
interface ProjectProps {
|
||||||
@@ -40,11 +42,14 @@ interface ProjectProps {
|
|||||||
<div class="flex flex-wrap gap-2 mb-6">
|
<div class="flex flex-wrap gap-2 mb-6">
|
||||||
{project.tags.map((tag: ProjectTag) => (
|
{project.tags.map((tag: ProjectTag) => (
|
||||||
<span class="inline-flex items-center px-3 py-1 bg-gray-800 text-gray-300 text-sm rounded-full">
|
<span class="inline-flex items-center px-3 py-1 bg-gray-800 text-gray-300 text-sm rounded-full">
|
||||||
<Icon
|
<div class="relative group">
|
||||||
name={tag.icon}
|
<Icon
|
||||||
class="w-6 h-6 mr-2"
|
name={tag.icon}
|
||||||
data-inline="false"
|
class="w-6 h-6 mr-2"
|
||||||
/>
|
data-inline="false"
|
||||||
|
/>
|
||||||
|
<Tooltip tooltip={tag.tooltip} />
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
{project.liveUrl && (
|
{project.liveUrl && (
|
||||||
|
|||||||
Reference in new issue
Block a user