From f6ff85e4264513699cf43340fc96da95bca83490 Mon Sep 17 00:00:00 2001 From: ssftvyn Date: Wed, 22 May 2024 21:28:40 +0500 Subject: [PATCH] button fix --- src/const.js | 8 ++++---- src/main.js | 2 +- src/view/new-point-button-view.js | 8 ++++++++ src/view/no-point-view.js | 1 - 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/const.js b/src/const.js index 1b5000f..25eced1 100644 --- a/src/const.js +++ b/src/const.js @@ -88,10 +88,10 @@ export const SortType = { }; export const NoPointsTextType = { - [FilterType.EVERYTHING]: 'Click New Event to create your first point', - [FilterType.PAST]: 'There are no past events now', - [FilterType.PRESENT]: 'There are no present events now', - [FilterType.FUTURE]: 'There are no future events now' + [FilterType.EVERYTHING]: 'click new event to create your first point', + [FilterType.PAST]: 'there are no past events now', + [FilterType.PRESENT]: 'there are no present events now', + [FilterType.FUTURE]: 'there are no future events now' }; export const Mode = { diff --git a/src/main.js b/src/main.js index 8f20a84..c0168b0 100644 --- a/src/main.js +++ b/src/main.js @@ -10,7 +10,7 @@ import PointsApiService from './api-service/points-api'; import DestinationsApiService from './api-service/destinations-api'; import OffersApiService from './api-service/offers-api'; -const AUTHORIZATION = 'Basic 2PV6hj7Xi2'; +const AUTHORIZATION = 'Basic hs0NCvhAEP'; const END_POINT = 'https://21.objects.htmlacademy.pro/big-trip'; const tripContainer = document.querySelector('.trip-events'); diff --git a/src/view/new-point-button-view.js b/src/view/new-point-button-view.js index 643b13b..76ff26c 100644 --- a/src/view/new-point-button-view.js +++ b/src/view/new-point-button-view.js @@ -17,5 +17,13 @@ export default class NewPointButtonView extends AbstractView { #clickHandler = (event) => { event.preventDefault(); this.#handleClick(); + this.#hideNoPointsText(); + }; + + #hideNoPointsText = () => { + const noPointsTextElement = document.querySelector('.trip-events__msg'); + if (noPointsTextElement) { + noPointsTextElement.style.display = 'none'; + } }; } diff --git a/src/view/no-point-view.js b/src/view/no-point-view.js index 4a4dc61..6e12c69 100644 --- a/src/view/no-point-view.js +++ b/src/view/no-point-view.js @@ -19,4 +19,3 @@ export default class NoPointView extends AbstractView { } } -