Files
grungnet/src/components/token/TokenStatus.js

27 lines
712 B
JavaScript
Raw Normal View History

2020-04-13 23:42:18 +10:00
import React from "react";
import { Circle, Group } from "react-konva";
2020-04-13 23:42:18 +10:00
import colors from "../../helpers/colors";
2020-04-13 23:42:18 +10:00
function TokenStatus({ tokenState, width, height }) {
2020-04-13 23:42:18 +10:00
return (
<Group x={width} y={height} offsetX={width / 2} offsetY={height / 2}>
{tokenState.statuses.map((status, index) => (
<Circle
2020-05-21 21:31:44 +10:00
key={status}
width={width}
height={height}
stroke={colors[status]}
strokeWidth={width / 20 / tokenState.size}
scaleX={1 - index / 10 / tokenState.size}
scaleY={1 - index / 10 / tokenState.size}
opacity={0.8}
fillEnabled={false}
/>
2020-04-13 23:42:18 +10:00
))}
</Group>
2020-04-13 23:42:18 +10:00
);
}
export default TokenStatus;