Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ボイボ寮の各キャラ紹介にaタグで遷移するように #103

Merged
9 changes: 4 additions & 5 deletions src/components/dormitoryCharacterCard.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import { Link } from "gatsby"
import { GatsbyImage } from "gatsby-plugin-image"
import React from "react"
import { CharacterInfo } from "../types/dormitoryCharacter"

export default ({
characterInfo,
onClick,
className = "",
}: {
characterInfo: CharacterInfo | undefined
onClick?: () => void
className?: string
}) => {
const color = characterInfo?.color || "black"
const href = characterInfo?.id ? `/dormitory/${characterInfo.id}` : "#"

return (
<>
<div className={"column is-3 " + className}>
<div
className="card character-card"
style={{ borderColor: color, height: "100%" }}
onClick={onClick}
>
{characterInfo ? (
<>
<Link to={href} state={{ fromDormitory: true }}>
<GatsbyImage
className="card-image"
image={characterInfo.bustupImage}
Expand All @@ -32,7 +31,7 @@ export default ({
<div className="card-content has-text-centered">
<h3 className="title is-5">{characterInfo.name}</h3>
</div>
</>
</Link>
) : (
<div className="card-content has-text-centered">Coming Soon...</div>
)}
Expand Down
Loading