Skip to content

Instantly share code, notes, and snippets.

@flagrede

flagrede/.tsx Secret

Last active June 27, 2020 16:17
Show Gist options
  • Save flagrede/dc21859cc3020454cd1dc3c6f5afabdb to your computer and use it in GitHub Desktop.
Save flagrede/dc21859cc3020454cd1dc3c6f5afabdb to your computer and use it in GitHub Desktop.
Zelda BOTW Part 1: Item component
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