Skip to content

Commit

Permalink
Шаблонизируй то2
Browse files Browse the repository at this point in the history
  • Loading branch information
lunianka committed Apr 14, 2024
1 parent 74f65ab commit 32684ea
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const FilterType = {
FUTURE: 'future',
PRESENT: 'present',
PAST: 'past'
}
};

export {
OFFER_COUNT,
Expand All @@ -78,4 +78,4 @@ export {
DEFAULT_TYPE,
POINT_EMPTY,
FilterType
}
};
2 changes: 1 addition & 1 deletion src/mock/filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { filter } from "../utils/filter.js";
import { filter } from '../utils/filter.js';

const generateFilters = (points) => {

Check failure on line 3 in src/mock/filter.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`
return Object.entries(filter)
Expand Down
6 changes: 3 additions & 3 deletions src/presenter/filter-presenter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FilterView from "../view/filter-view.js";
import { render } from "../framework/render.js";
import { generateFilters } from "../mock/filter.js";
import FilterView from '../view/filter-view.js';
import { render } from '../framework/render.js';
import { generateFilters } from '../mock/filter.js';

export default class FilterPresenter {
#container = null;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TimePeriods = {
SEC_IN_MIN: 60,
MIN_IN_HOUR: 60,
HOUR_IN_DAY: 24
}
};

const MSEC_IN_HOUR = TimePeriods.MIN_IN_HOUR * TimePeriods.SEC_IN_MIN * TimePeriods.MSEC_IN_SEC;
const MSEC_IN_DAY = TimePeriods.HOUR_IN_DAY * MSEC_IN_HOUR;
Expand Down Expand Up @@ -110,4 +110,4 @@ export {
isPointFuture,
isPointPast,
isPointPresent
}
};
4 changes: 2 additions & 2 deletions src/utils/filter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FilterType } from "../const.js";
import { isPointFuture, isPointPresent, isPointPast } from "../utils.js";
import { FilterType } from '../const.js';
import { isPointFuture, isPointPresent, isPointPast } from '../utils.js';

const filter = {
[FilterType.EVERYTHING]: (points) => [...points],
Expand Down
4 changes: 2 additions & 2 deletions src/view/empty-list-view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AbstractView from "../framework/view/abstract-view.js";
import AbstractView from '../framework/view/abstract-view.js';

const createEmptyListViewTemplate = () => {
return (
Expand All @@ -7,7 +7,7 @@ const createEmptyListViewTemplate = () => {
<p class="trip-events__msg">Click New Event to create your first point</p>
</section>`
);
}
};

export default class EmptyListView extends AbstractView {
get template() {
Expand Down
6 changes: 3 additions & 3 deletions src/view/filter-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const createFilterItemsTemplate = ({ filters }) => {
${(filter.hasPoints) ? '' : 'disabled'}>
<label class="trip-filters__filter-label" for="filter-${filter.type}">${capitalize(filter.type)}</label>
</div>`
)
);
}).join('');

return filterItems;
}
};

const createFilterTemplate = ({ filters }) => {
return (
Expand All @@ -22,7 +22,7 @@ const createFilterTemplate = ({ filters }) => {
<button class="visually-hidden" type="submit">Accept filter</button>
</form>`
);
}
};

export default class FilterView extends AbstractView {
#filters = [];
Expand Down
2 changes: 1 addition & 1 deletion src/view/point-list-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const createPointListTemplate = () => {
return (
`<ul class="trip-events__list"><ul>`
);
}
};

export default class PointListView extends AbstractView {
get template() {
Expand Down

0 comments on commit 32684ea

Please sign in to comment.