Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezryr committed Nov 18, 2024
1 parent f623b8a commit 0940ee8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions components/PlantCalendarRow/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo } from 'react';
import React, { useMemo } from 'react';
import { fillCalendarGridArrayRowWithColor } from '@/utils/helpers';
import {
CalendarCell,
Expand All @@ -17,7 +17,6 @@ interface PlantCalendarRowProps {
indoorsEnd: string;
outdoorsStart: string;
outdoorsEnd: string;
showMonths: boolean;
}

export default function PlantCalendarRow({
Expand All @@ -30,7 +29,6 @@ export default function PlantCalendarRow({
indoorsEnd,
outdoorsStart,
outdoorsEnd,
showMonths,
}: PlantCalendarRowProps) {
const colors = {
indoors: '#F5B868',
Expand Down
3 changes: 1 addition & 2 deletions components/PlantList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const PlantList = ({
{filteredPlantList.map((plant, key) => (
//this should display PlantCalendarRows instead of this temporary div
<PlantCalendarRow
key={key}
plantName={plant.plant_name}
harvestStart={plant.harvest_start}
harvestEnd={plant.harvest_end}
Expand All @@ -76,8 +77,6 @@ export const PlantList = ({
indoorsEnd={plant.indoors_end}
outdoorsStart={plant.outdoors_start}
outdoorsEnd={plant.outdoors_end}
// only show months header for the first plant
showMonths={key === 0}
/>
))}
</CalendarRowsContainer>
Expand Down
4 changes: 2 additions & 2 deletions utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ export function fillCalendarGridArrayRowWithColor(
// if the start month is LATE_MONTH, start column should be the second column for that month
// if the end month is EARLY_MONTH, end column should be the first column for that month
// otherwise, start column should be the first column and end column should be the second column for that month
let startColumn = startMonth.startsWith('LATE')
const startColumn = startMonth.startsWith('LATE')
? monthToIndex.get(processedStartMonth)! * 2 + 1
: monthToIndex.get(processedStartMonth)! * 2;
let endColumn = endMonth.startsWith('EARLY')
const endColumn = endMonth.startsWith('EARLY')
? monthToIndex.get(processedEndMonth)! * 2
: monthToIndex.get(processedEndMonth)! * 2 + 1;

Expand Down

0 comments on commit 0940ee8

Please sign in to comment.