added ImageCarousel component, added icons to action buttons, modified project route

This commit is contained in:
2026-01-13 00:15:08 -05:00
parent 20321ece21
commit 2d945f6015
5 changed files with 103 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
import { useState } from "preact/hooks";
import { Portal } from "./Portal.tsx";
import { type ModalAction, ProjectModal } from "./ProjectModal.tsx";
import { ImageCarousel } from "./ImageCarousel.tsx";
import * as hi from "@preact-icons/hi2";
export const ProjectCard = function ProjectCard(props: ProjectProps) {
const [open, setOpen] = useState(false);
@@ -8,6 +10,7 @@ export const ProjectCard = function ProjectCard(props: ProjectProps) {
const modalButtons: Array<ModalAction> = [
{
label: "Open repository",
icon: <hi.HiCodeBracket />,
onClick: () => {
if (props.repo) globalThis.open(props.repo, "_blank");
},
@@ -31,7 +34,6 @@ export const ProjectCard = function ProjectCard(props: ProjectProps) {
}
onClick={() => {
// clicking the card (not the link) opens the modal
console.log("opened portal");
setOpen(true);
}}
>
@@ -69,6 +71,9 @@ export const ProjectCard = function ProjectCard(props: ProjectProps) {
actions={modalButtons}
>
<div class="space-y-3">
{props.images && props.images.length > 0 && (
<ImageCarousel images={props.images} />
)}
<p class="text-sm text-gray-800 dark:text-gray-200">
{props.description}
</p>
@@ -90,4 +95,5 @@ type ProjectProps = {
description?: string;
tech: string;
wip?: boolean;
images?: string[];
};