diff --git a/src/presenter/waypoints-list-presenter.js b/src/presenter/waypoints-list-presenter.js index 8d9445a..4175755 100644 --- a/src/presenter/waypoints-list-presenter.js +++ b/src/presenter/waypoints-list-presenter.js @@ -107,6 +107,20 @@ export default class WaypointsListPresenter { filteredPoints.forEach((waypoint) => this.#renderWaypoint(waypoint)); } + #renderInfo() { + const route = getRoute( + this.#sortWaypoints(SORTING_TYPES.DAY, this.waypointsModel.getWaypoints()), + this.waypointsModel.destinations + ); + this.#infoComponent = new InfoView({ + route: route.route, + routeDates: route.routeDates, + totalPrice: getTotalPrice(this.waypointsModel.getWaypoints(), this.waypointsModel.offers), + }); + + render(this.#infoComponent, this.#mainContainer, RenderPosition.AFTERBEGIN); + } + reset() { this.#waypointPresenters.forEach((waypointPresenter) => waypointPresenter.destroy()); this.#waypointPresenters = [];