Skip to content

Commit

Permalink
add middle click to open scryfall page for card
Browse files Browse the repository at this point in the history
  • Loading branch information
dsoskey committed Jan 20, 2024
1 parent 5ae6acd commit 89280cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ui/cardBrowser/cardViews/cardImageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@ export const CardImageView = ({
}
}

const href = card.data.scryfall_uri.replace(/\?.*$/, '')

return (
<div className={`card-view ${card.data.set} ${className}`} ref={cardViewRef}
tabIndex={-1}
onKeyDown={handleKeyPress}
onMouseOver={handleHoverOn}
onMouseLeave={handleHoverOff}
onAuxClick={e => {
if (e.button === 1) {
window.open(href, "_blank");
}
}}
>
{showRender && <CardCustomRender card={card.data} />}
{!showRender && <CardImage card={card.data} />}
Expand Down

0 comments on commit 89280cc

Please sign in to comment.