-
-
Save flagrede/dc21859cc3020454cd1dc3c6f5afabdb to your computer and use it in GitHub Desktop.
Zelda BOTW Part 1: Item component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext } from "react"; | |
type Props = { | |
name: string; | |
icon: string; | |
value: string; | |
}; | |
const Item: React.FC<Props> = ({ name, icon, value }) => { | |
return ( | |
<div className="relative w-20 h-20 bg-black border border-zelda-darkGray cursor-pointer"> | |
<img alt={name} src={icon} /> | |
<div className="z-0 bg-black -mx-1 -my-1 text-sm text-white absolute bottom-0 right-0 border border-zelda-darkGray px-2"> | |
{value} | |
</div> | |
</div> | |
); | |
}; | |
export default Item; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment