Files
ukraine-timemap/src/components/presentational/Timeline/Project.js
Lachlan Kermode 1bbcd57e5e Fix/clean errors (#191)
* clean dev errors

* add check command

* yarn -> npm in travis

* fix all warnings

* fix base test

* 💄
2021-01-17 18:16:28 +13:00

31 lines
495 B
JavaScript

import React from "react";
const Project = ({
offset,
id,
start,
end,
getX,
y,
dims,
colour,
eventRadius,
onClick,
}) => {
const length = getX(end) - getX(start);
if (offset === undefined) return null;
return (
<rect
onClick={onClick}
className="project"
x={getX(start)}
y={dims.marginTop + offset}
width={length}
style={{ fill: colour, fillOpacity: 0.2 }}
height={2 * eventRadius}
/>
);
};
export default Project;