refactoring components to match the optimized projections
This commit is contained in:
@@ -124,17 +124,17 @@ export const MonthLocationList:React.FC<MonthLocationListProps > = ({
|
||||
<AddMonthButton yearMonth={getNextYearMonth(monthsArray[0][1].locations[0].yearMonth)} />
|
||||
{
|
||||
monthsArray.map(([monthKey, { yearMonth, locations, monthlyExpense }], monthIx) =>
|
||||
<MonthCard yearMonth={yearMonth} key={`month-${monthKey}`} monthlyExpense={monthlyExpense} currency={userSettings?.currency} expanded={ yearMonth.month === expandedMonth } onToggle={handleMonthToggle} >
|
||||
{
|
||||
yearMonth.month === expandedMonth ?
|
||||
locations.map((location, ix) => <LocationCard key={`location-${location._id}`} location={location} currency={userSettings?.currency} />)
|
||||
: null
|
||||
}
|
||||
<div className="flex gap-2 justify-center">
|
||||
<AddLocationButton yearMonth={yearMonth} />
|
||||
<PrintButton yearMonth={yearMonth} />
|
||||
</div>
|
||||
</MonthCard>
|
||||
<MonthCard yearMonth={yearMonth} key={`month-${monthKey}`} monthlyExpense={monthlyExpense} currency={userSettings?.currency} expanded={ yearMonth.month === expandedMonth } onToggle={handleMonthToggle} >
|
||||
{
|
||||
yearMonth.month === expandedMonth ?
|
||||
locations.map((location, ix) => <LocationCard key={`location-${location._id}`} location={location} currency={userSettings?.currency} />)
|
||||
: null
|
||||
}
|
||||
<div className="flex gap-2 justify-center">
|
||||
<AddLocationButton yearMonth={yearMonth} />
|
||||
<PrintButton yearMonth={yearMonth} />
|
||||
</div>
|
||||
</MonthCard>
|
||||
)
|
||||
}
|
||||
<div className="mt-5 flex w-full justify-center">
|
||||
|
||||
Reference in New Issue
Block a user