Skip to content
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
29 changes: 29 additions & 0 deletions app/components/ProductCard/ProductCard.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,34 @@ export const NekoBot: Story = {
stars: 1,
commits: 142,
pullRequests: 75,
linkedButtons: [
{
url: 'https://github.com/naoido/neko-bot',
label: 'Github',
},
]
}
}

export const Website: Story = {
args: {
headerImage: "https://pbs.twimg.com/profile_banners/1846395762277826560/1737992837/1500x500",
title: "団体公式サイト",
stacks: ["Cloudflare", "React", "Cloudflareworkers"],
description: "団体公式のウェブサイトです。Reactで構成されており、Cloudfalre Workers使用し記事の更新などを行い、Cloudflare Pagesにデプロイしています。",
stars: 2,
commits: 86,
pullRequests: 54,
linkedButtons: [
{
url: 'https://github.com/object-t/object-t-website',
label: 'Github',
},
{
url: "https://www.figma.com/design/YWBtX9qhd0QKOTY4a2SEWx",
label: "Figma",
}
]
}
}

13 changes: 13 additions & 0 deletions app/components/ProductCard/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { Devicon } from "../Devicon/Devicon"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faStar } from "@fortawesome/free-regular-svg-icons";
import { faCodeBranch, faCodePullRequest } from "@fortawesome/free-solid-svg-icons";
import { LinkedButton } from "../LinkedButton/LinkedButton";
import type { LinkedButtonProps } from "../LinkedButton/LinkedButton";

import "./product-card.css"



export interface ProductCardProps {
headerImage: string;
title: string;
Expand All @@ -13,6 +17,7 @@ export interface ProductCardProps {
stars: number;
commits: number;
pullRequests: number;
linkedButtons?: LinkedButtonProps[];
}

export const ProductCard = ({
Expand All @@ -23,6 +28,7 @@ export const ProductCard = ({
stars,
commits,
pullRequests,
linkedButtons,
...props
}: ProductCardProps) => {
return (
Expand Down Expand Up @@ -66,6 +72,13 @@ export const ProductCard = ({
<div className="repo-info-number">{pullRequests}</div>
</div>
</div>
<div className="product-button-container">
{linkedButtons?.map((prop, index) => (
<div className="product-button" key={prop.url || index}>
<LinkedButton url={prop.url} label={prop.label} style={prop.style} backgroundColor={prop.backgroundColor} color={prop.color} />
</div>
))}
</div>
</div>
)
}
Expand Down
11 changes: 11 additions & 0 deletions app/components/ProductCard/product-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,14 @@
font-size: 48px;
color: var(--grey-text-color);
}

.product-button-container {
margin-top: 40px;
display: flex;
align-items: center;
justify-content: center;
}

.product-button {
margin: 0 10px 0;
}