Make var names more precise
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user