Add support for right-down arrows

This commit is contained in:
Melvin Valster
2019-07-24 13:25:57 +02:00
parent d5121960a1
commit 94a0a97fbf
6 changed files with 180 additions and 66 deletions
+3 -6
View File
@@ -14,6 +14,7 @@ interface Props {
export const TalentTree: React.FC<Props> = ({ specId, knownTalents, availablePoints, onTalentPress }) => {
const talents = Object.values(talentsBySpec[specId])
const bgImg = require(`../images/specs/${specId}.jpg`)
const handleClick = useCallback(
(talentId) => onTalentPress(specId, talentId, 1),
@@ -24,12 +25,8 @@ export const TalentTree: React.FC<Props> = ({ specId, knownTalents, availablePoi
[specId, onTalentPress]
)
const bodyStyle = {
backgroundImage: `url(${require(`../images/specs/${specId}.jpg`)})`
}
const arrows = talents
.filter((talent) => talent.requires.length > 0)
.filter((talent) => talent.requires.length)
.map((talent) => {
return <Arrow
key={talent.id}
@@ -45,7 +42,7 @@ export const TalentTree: React.FC<Props> = ({ specId, knownTalents, availablePoi
<h3>{specNames[specId]} ({getPointsInSpec(specId, knownTalents)})</h3>
</div>
<div className="tree__body" style={bodyStyle}>
<div className="tree__body" style={{ backgroundImage: `url(${bgImg})` }}>
{talents.map((talent) =>
<TalentSlot
key={talent.id}