Make var names more precise

This commit is contained in:
bl00dymarie
2024-04-05 18:21:25 +02:00
parent baa057229e
commit ea8e13e90f
+10 -8
View File
@@ -134,14 +134,16 @@ const CycleChart = ({ navigate, setDate }) => {
) )
} }
const getcomputedDateInView = () => { const getLeftmostComputedDateInView = () => {
const columnIndex = Math.floor(currentScrollPosition / CHART_COLUMN_WIDTH) const rightmostVisibleIndexInView = Math.floor(
const leftIndex = currentScrollPosition / CHART_COLUMN_WIDTH
columnIndex + numberOfColumnsToRender >= columns.length )
const leftmostVisibleIndexInView =
rightmostVisibleIndexInView + numberOfColumnsToRender >= columns.length
? 153 ? 153
: columnIndex + numberOfColumnsToRender : rightmostVisibleIndexInView + numberOfColumnsToRender
// detect oldest visible day to render its month dynamically // detect leftmost aka oldest visible day to render its month dynamically
return columns[leftIndex] return columns[leftmostVisibleIndexInView]
} }
const renderColumn = ({ item }) => { const renderColumn = ({ item }) => {
@@ -181,7 +183,7 @@ const CycleChart = ({ navigate, setDate }) => {
symptomsSectionHeight={symptomRowHeight} symptomsSectionHeight={symptomRowHeight}
shouldShowTemperatureColumn={shouldShowTemperatureColumn} shouldShowTemperatureColumn={shouldShowTemperatureColumn}
xAxisHeight={xAxisHeight} xAxisHeight={xAxisHeight}
computedDate={getcomputedDateInView()} computedDate={getLeftmostComputedDateInView()}
/> />
<MainGrid <MainGrid
data={columns} data={columns}