added ImageCarousel component, added icons to action buttons, modified project route
This commit is contained in:
@@ -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[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user