editable outfit name
This commit is contained in:
parent
e67ca7dc34
commit
32b31c6596
1 changed files with 47 additions and 12 deletions
|
@ -4,9 +4,13 @@ import {
|
||||||
Flex,
|
Flex,
|
||||||
Grid,
|
Grid,
|
||||||
Heading,
|
Heading,
|
||||||
|
IconButton,
|
||||||
Image,
|
Image,
|
||||||
Stack,
|
Stack,
|
||||||
PseudoBox,
|
PseudoBox,
|
||||||
|
Editable,
|
||||||
|
EditablePreview,
|
||||||
|
EditableInput,
|
||||||
} from "@chakra-ui/core";
|
} from "@chakra-ui/core";
|
||||||
|
|
||||||
import useOutfitState from "./useOutfitState.js";
|
import useOutfitState from "./useOutfitState.js";
|
||||||
|
@ -58,6 +62,36 @@ function ItemsPanel() {
|
||||||
const [zonesAndItems, wearItem] = useOutfitState();
|
const [zonesAndItems, wearItem] = useOutfitState();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<PseudoBox role="group" d="inline-block">
|
||||||
|
<Heading size="xl" mb="6" wordBreak="break-word">
|
||||||
|
<Editable defaultValue="roopal27">
|
||||||
|
{({ isEditing, onRequestEdit }) => (
|
||||||
|
<>
|
||||||
|
<EditablePreview d="inline" />
|
||||||
|
<EditableInput />
|
||||||
|
{!isEditing && (
|
||||||
|
<PseudoBox
|
||||||
|
d="inline-block"
|
||||||
|
opacity="0"
|
||||||
|
transition="opacity 0.5s"
|
||||||
|
_groupHover={{ opacity: "1" }}
|
||||||
|
onClick={onRequestEdit}
|
||||||
|
>
|
||||||
|
<IconButton
|
||||||
|
icon="edit"
|
||||||
|
variant="link"
|
||||||
|
color="gray.600"
|
||||||
|
aria-label="Edit outfit name"
|
||||||
|
title="Edit outfit name"
|
||||||
|
/>
|
||||||
|
</PseudoBox>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Editable>
|
||||||
|
</Heading>
|
||||||
|
</PseudoBox>
|
||||||
<Stack spacing="10">
|
<Stack spacing="10">
|
||||||
{zonesAndItems.map(({ zoneName, items, wornItemId }) => (
|
{zonesAndItems.map(({ zoneName, items, wornItemId }) => (
|
||||||
<Box key={zoneName}>
|
<Box key={zoneName}>
|
||||||
|
@ -70,6 +104,7 @@ function ItemsPanel() {
|
||||||
</Box>
|
</Box>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue