-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
156 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const MAX_REBIRTHS = 6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Flex, Image, useColorMode } from "@chakra-ui/react"; | ||
|
||
export default function ItemSlot({ image }: { image?: string }) { | ||
const dark = useColorMode().colorMode == "dark"; | ||
|
||
return ( | ||
<Flex | ||
p={4} | ||
bgColor={dark ? "gray.900" : "gray.50"} | ||
borderRadius={8} | ||
justify="center" | ||
align="center" | ||
> | ||
<Flex | ||
w={12} | ||
h={12} | ||
justify="center" | ||
align="center" | ||
backgroundColor={dark ? "gray.800" : "gray.200"} | ||
borderWidth={1} | ||
borderColor={dark ? "gray.400" : "gray.600"} | ||
borderStyle="dashed" | ||
> | ||
<Image src={image} /> | ||
</Flex> | ||
</Flex> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Flex, Image, Stack, Tag, Text, useColorMode } from "@chakra-ui/react"; | ||
import { | ||
MATERIAL_INFOS, | ||
MATERIAL_TYPE, | ||
} from "../../../../constants/enhance/material"; | ||
import { useAppSelector } from "../../../../stores/hooks"; | ||
import ItemSlot from "../common/itemSlot"; | ||
import OptionsButton from "../common/optionButton"; | ||
import { MAX_REBIRTHS } from "../../../../constants/enhance/rebirth"; | ||
import { isSelectable } from "../../../../services/enhance/rebirth"; | ||
|
||
export default function Rebirth({ | ||
inventoryIndex, | ||
materialType, | ||
}: { | ||
inventoryIndex: number; | ||
materialType: MATERIAL_TYPE; | ||
}) { | ||
const inventory = useAppSelector((state) => state.user.inventory); | ||
|
||
const item = inventory[inventoryIndex].after; | ||
const selectable = isSelectable(materialType); | ||
|
||
return ( | ||
<Stack width={{ base: "100%", md: 60 }}> | ||
<Tag as={Flex} px={2} py={1} gap={2}> | ||
<Image src={MATERIAL_INFOS[materialType].icon} /> | ||
<Text size="xs"> | ||
아이템의 <b>추가옵션을</b> 재설정합니다. | ||
</Text> | ||
</Tag> | ||
<ItemSlot image={item?.item_icon} /> | ||
<OptionsButton | ||
title={selectable ? "BEFORE" : "RESULT"} | ||
options={[ | ||
"STR: +30", | ||
"DEX: +30", | ||
"INT: +25", | ||
"LUK: +25", | ||
"공격력: +5", | ||
"올스탯: +6%", | ||
]} | ||
maxOptionCount={MAX_REBIRTHS} | ||
onClick={selectable ? () => {} : undefined} | ||
/> | ||
{selectable && ( | ||
<OptionsButton | ||
title="AFTER" | ||
options={["STR: +30", "DEX: +25", "LUK: +109", "올스탯: +6%"]} | ||
maxOptionCount={MAX_REBIRTHS} | ||
onClick={() => {}} | ||
/> | ||
)} | ||
</Stack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { MATERIAL_TYPE } from "../../constants/enhance/material"; | ||
|
||
export function isSelectable(materialType: MATERIAL_TYPE) { | ||
return [MATERIAL_TYPE.BLACK_REBIRTH, MATERIAL_TYPE.ABYSS].includes( | ||
materialType | ||
); | ||
} |