Skip to content

Instantly share code, notes, and snippets.

@flagrede

flagrede/.tsx Secret

Last active June 27, 2020 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flagrede/f752e3e2de8cbb6a7edf1609dc42f9b7 to your computer and use it in GitHub Desktop.
Save flagrede/f752e3e2de8cbb6a7edf1609dc42f9b7 to your computer and use it in GitHub Desktop.
Zelda BOTW Part 1: ItemsGrid component
import React from "react";
import Item from "./Item";
import { ItemType } from "../data/items.type";
type Props = {
items: ItemType[];
};
const ItemsGrid: React.FC<Props> = ({ items }) => (
<div className="grid grid-cols-3 md:grid-cols-5 gap-6">
{items.map((item, index) => (
<Item
key={`${item.name}-${index}`}
name={item.name}
icon={item.icon}
value={item.value}
/>
))}
</div>
);
export default ItemsGrid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment