GridRow.js
460 Bytes
import { moveDate } from "../utils/Dates";
import GridItem from "./GridItem";
const GridRow = ({ startDate }) => {
const renderItems = () => {
const items = [];
const ndate = new Date(startDate);
for (let i = 0; i < 7; i++) {
items.push(<GridItem key={i} targetDate={new Date(ndate)} />);
moveDate(ndate, "day", 1);
}
return items;
};
return <div className="GridRow">{renderItems()}</div>;
};
export default GridRow;