gantt-task-react/src/components/calendar/top-part-of-calendar.tsx

42 lines
739 B
TypeScript
Raw Normal View History

2020-08-05 08:14:22 +03:00
import React from "react";
import styles from "./calendar.module.css";
2020-07-22 20:50:43 +03:00
type TopPartOfCalendarProps = {
value: string;
x1Line: number;
y1Line: number;
y2Line: number;
xText: number;
yText: number;
};
export const TopPartOfCalendar: React.FC<TopPartOfCalendarProps> = ({
value,
x1Line,
y1Line,
y2Line,
xText,
yText,
}) => {
return (
2020-08-05 08:14:22 +03:00
<g className="calendarTop">
2020-07-22 20:50:43 +03:00
<line
x1={x1Line}
y1={y1Line}
x2={x1Line}
y2={y2Line}
2020-08-05 08:14:22 +03:00
className={styles.calendarTopTick}
key={value + "line"}
/>
2020-07-22 20:50:43 +03:00
<text
2020-08-05 08:14:22 +03:00
key={value + "text"}
2020-07-22 20:50:43 +03:00
y={yText}
x={xText}
2020-08-05 08:14:22 +03:00
className={styles.calendarTopText}
2020-07-22 20:50:43 +03:00
>
{value}
</text>
2020-08-05 08:14:22 +03:00
</g>
2020-07-22 20:50:43 +03:00
);
};