2020-04-13 23:42:18 +10:00
|
|
|
import React from "react";
|
2020-05-21 20:57:52 +10:00
|
|
|
import { Circle, Group } from "react-konva";
|
2020-04-13 23:42:18 +10:00
|
|
|
|
2020-04-23 10:09:12 +10:00
|
|
|
import colors from "../../helpers/colors";
|
2020-04-13 23:42:18 +10:00
|
|
|
|
2020-05-21 20:57:52 +10:00
|
|
|
function TokenStatus({ tokenState, width, height }) {
|
2020-04-13 23:42:18 +10:00
|
|
|
return (
|
2020-05-21 20:57:52 +10:00
|
|
|
<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}
|
2020-05-21 20:57:52 +10:00
|
|
|
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}
|
2020-05-29 07:50:03 +10:00
|
|
|
fillEnabled={false}
|
2020-05-21 20:57:52 +10:00
|
|
|
/>
|
2020-04-13 23:42:18 +10:00
|
|
|
))}
|
2020-05-21 20:57:52 +10:00
|
|
|
</Group>
|
2020-04-13 23:42:18 +10:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default TokenStatus;
|