import { Box, Flex, Image } from "@chakra-ui/core"; import { Trans } from "@lingui/macro"; import WeaponImage from "lib/components/WeaponImage"; import { weapons } from "lib/lists/weapons"; import { useMyTheme } from "lib/useMyTheme"; import { useState } from "react"; import Draggable from "react-draggable"; interface DraggableImageAdderProps { addImageToSketch: (imgSrc: string) => void; } const DraggableImageAdder: React.FC = ({ addImageToSketch, }) => { const { bgColor } = useMyTheme(); const [activeDrags, setActiveDrags] = useState(0); const onStart = () => { setActiveDrags(activeDrags + 1); }; const onStop = () => { setActiveDrags(activeDrags - 1); }; return (
Add image
{weapons.map((wpn) => ( addImageToSketch( `/images/weapons/${wpn.replace(".", "")}.png` ) } m="3px" > ))} {["Blaster", "Brella", "Charger", "Slosher"].map( (grizzcoWeaponClass) => { const imgSrc = `/images/weapons/Grizzco ${grizzcoWeaponClass}.png`; return ( addImageToSketch(imgSrc)} src={imgSrc} w={8} h={8} m="3px" ignoreFallback /> ); } )} {["TC", "RM", "CB"].map((mode) => { const imgSrc = `/images/modeIcons/${mode}.png`; return ( addImageToSketch(imgSrc)} src={imgSrc} w={8} h={8} m="3px" ignoreFallback /> ); })} {[ "Drizzler", "Flyfish", "Goldie", "Griller", "Maws", "Scrapper", "Steel Eal", "Steelhead", "Stinger", "Golden Egg", ].map((boss) => { const imgSrc = `/images/salmonRunIcons/${boss}.png`; return ( addImageToSketch(imgSrc)} src={imgSrc} w={8} h={8} m="3px" ignoreFallback /> ); })}
); }; export default DraggableImageAdder;