Skip to content

Commit

Permalink
fix naming inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
HuzzNZ committed May 5, 2024
1 parent f34ab61 commit 49147a4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend/app/(cms)/pollen/components/PollenCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import DateInput from "@/app/(cms)/pollen/components/DateInput"
import MultiChart from "@/app/(cms)/pollen/components/MultiChart"

const PollenCalendar = memo(function PollenCalendar({ pollenData }: { pollenData: PollenData[] }) {
const [showingDateFilter, showDateFilter] = useState(false)
const [showsDateFilter, setShowsDateFilter] = useState(false)
const [dateLowerLimit, setDateLowerLimit] = useState(dayjs("2024-11-28").valueOf())
const [dateUpperLimit, setDateUpperLimit] = useState(dayjs("2024-12-2").valueOf())

const [showingPollenTypeFilter, showPollenTypeFilter] = useState(false)
const [showsPollenTypeFilter, setShowsPollenTypeFilter] = useState(false)
const [allPollenTypes, setAllPollenTypes] = useState<string[]>([])
const [displayedPollenTypes, displayPollenTypes] = useState<string[]>([])
const [displayedPollenTypes, setDisplayedPollenTypes] = useState<string[]>([])

const [formattedPollenData, setFormattedPollenData] = useState<null | FormattedPollenData>(null)
const [filteredPollenData, setFilteredPollenData] = useState<null | FormattedPollenData>(null)
Expand All @@ -24,7 +24,7 @@ const PollenCalendar = memo(function PollenCalendar({ pollenData }: { pollenData

const allPollenNames = formatted.pollenTypes.map((pollenType) => pollenType)
setAllPollenTypes(allPollenNames)
displayPollenTypes(allPollenNames)
setDisplayedPollenTypes(allPollenNames)
}, [pollenData])

useEffect(() => {
Expand Down Expand Up @@ -54,14 +54,14 @@ const PollenCalendar = memo(function PollenCalendar({ pollenData }: { pollenData
<div className="flex gap-4 items-center">
<button
className="button w-40 inline-block text-nowrap"
onClick={() => showPollenTypeFilter((currentState) => !currentState)}>
onClick={() => setShowsPollenTypeFilter((currentState) => !currentState)}>
Pollen Type
</button>
<div>
{allPollenTypes && showingPollenTypeFilter && (
{allPollenTypes && showsPollenTypeFilter && (
<PollenTypeInput
allPollenTypes={allPollenTypes}
displayPollenTypes={displayPollenTypes}
displayPollenTypes={setDisplayedPollenTypes}
/>
)}
</div>
Expand All @@ -70,10 +70,10 @@ const PollenCalendar = memo(function PollenCalendar({ pollenData }: { pollenData
<div className="flex gap-4 items-center">
<button
className="button w-40 inline-block"
onClick={() => showDateFilter((currentState) => !currentState)}>
onClick={() => setShowsDateFilter((currentState) => !currentState)}>
Date
</button>
{showingDateFilter && (
{showsDateFilter && (
<DateInput
lowerLimit={dateLowerLimit}
upperLimit={dateUpperLimit}
Expand Down

0 comments on commit 49147a4

Please sign in to comment.