/.tsx Secret
Last active
June 27, 2020 16:17
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