Add conditional rendering to token status and label

This commit is contained in:
Mitchell McCaffrey 2021-06-17 11:39:41 +10:00
parent 78dac55d7a
commit e352cadaea

View File

@ -248,16 +248,20 @@ function MapToken({
hitFunc={() => {}} hitFunc={() => {}}
/> />
<Group offsetX={tokenWidth / 2} offsetY={tokenHeight / 2}> <Group offsetX={tokenWidth / 2} offsetY={tokenHeight / 2}>
<TokenStatus {tokenState.statuses?.length > 0 ? (
tokenState={tokenState} <TokenStatus
width={tokenWidth} tokenState={tokenState}
height={tokenHeight} width={tokenWidth}
/> height={tokenHeight}
<TokenLabel />
tokenState={tokenState} ) : null}
width={tokenWidth} {tokenState.label ? (
height={tokenHeight} <TokenLabel
/> tokenState={tokenState}
width={tokenWidth}
height={tokenHeight}
/>
) : null}
</Group> </Group>
</animated.Group> </animated.Group>
); );