make whole card of skin library item clickable

This commit is contained in:
Pig Fang 2021-08-19 23:15:56 +08:00
parent 7512eeb465
commit c12c1fbd01
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2

View File

@ -64,12 +64,13 @@ const Item: React.FC<Props> = (props) => {
props.onUploaderClick(item.uploader)
}
const handleHeartClick = () => {
const handleHeartClick = (event: React.MouseEvent) => {
event.preventDefault()
props.liked ? props.onRemove(item) : props.onAdd(item)
}
return (
<div className="ml-3 mr-2 mb-2">
<a href={link} className="ml-3 mr-2 mb-2 d-block" target="_blank">
<Card className="card">
<div className="card-body">
{item.public || (
@ -82,14 +83,9 @@ const Item: React.FC<Props> = (props) => {
</a>
</div>
<div className="card-footer">
<a
className="d-block mb-1 text-truncate"
title={item.name}
href={link}
target="_blank"
>
<span className="d-block mb-1 text-truncate" title={item.name}>
{item.name}
</a>
</span>
<div className="d-flex justify-content-between">
<div className="d-flex">
<Badge className="badge bg-teal mr-1">
@ -114,7 +110,7 @@ const Item: React.FC<Props> = (props) => {
</div>
</div>
</Card>
</div>
</a>
)
}