import React from "react";
import { css } from "emotion";
import { CSSTransition, TransitionGroup } from "react-transition-group";
import {
Box,
Flex,
IconButton,
Image,
PseudoBox,
Skeleton,
Tooltip,
useTheme,
} from "@chakra-ui/core";
import "./ItemList.css";
function ItemList({ items, outfitState, dispatchToOutfit }) {
return (
{items.map((item) => (
{
e.style.height = e.offsetHeight + "px";
}}
>
))}
);
}
export function ItemListContainer({ children }) {
return {children};
}
export function ItemListSkeleton({ count }) {
return (
{Array.from({ length: count }).map((_, i) => (
))}
);
}
export function Item({ item, outfitState, dispatchToOutfit }) {
const { allItemIds } = outfitState;
const isInOutfit = allItemIds.includes(item.id);
const theme = useTheme();
return (
{item.name}
{isInOutfit && (
{
e.stopPropagation();
dispatchToOutfit({ type: "removeItem", itemId: item.id });
}}
opacity="0"
transitionProperty="opacity color"
transitionDuration="0.2s"
className={css`
&:hover,
&:focus,
input:focus + .item-container & {
opacity: 1;
color: ${theme.colors.gray["800"]};
backgroundcolor: ${theme.colors.gray["200"]};
}
`}
/>
)}
);
}
function ItemSkeleton() {
return (
);
}
function ItemContainer({ children }) {
const theme = useTheme();
return (
{children}
);
}
function ItemThumbnail({ src }) {
const theme = useTheme();
return (
);
}
function ItemName({ children }) {
const theme = useTheme();
return (
{children}
);
}
export default ItemList;