Skip to content

Commit

Permalink
HAR-68: Добавил комментарии к коду
Browse files Browse the repository at this point in the history
  • Loading branch information
glebkos committed Apr 3, 2024
1 parent 2437808 commit 21f3d1e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 13 deletions.
4 changes: 2 additions & 2 deletions source/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Navbar} from '../components/widget/navbar/navbar.js';
import {API} from '../shared/api/API.js';
import {Error} from '../components/pages/error/error.js';
import './App.css';
import {BoardView} from '../pages/boardView/ui/boardView.js';
// import {BoardView} from '../pages/boardView/ui/boardView.js';
import {BoardEdit} from '../pages/boardEdit/ui/boardEdit.js';
// import {Profile} from '../pages/profile/ui/profile.js';
// import {ProfileEdit} from '../pages/profileEdit/ui/profileEdit.js';
Expand Down Expand Up @@ -38,7 +38,7 @@ profileEdit.render(profileEdit.user); */
boardView.render(boardView.board); */
/* const boardEdit = new BoardEdit();
boardEdit.renderUpdateBoard(boardEdit.board); */
const boardCreate = new BoardEdit()
const boardCreate = new BoardEdit();
boardCreate.renderCreateBoard();
// Feed();

12 changes: 6 additions & 6 deletions source/app/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export class View {
};
this.board = {
board_id: 1,
title: "This is my board",
created_at: "01.04.2024",
description: "My first experience of making a board on this service",
cover_url: "",
visibility_type: "public",
}
title: 'This is my board',
created_at: '01.04.2024',
description: 'My first experience of making a board on this service',
cover_url: '',
visibility_type: 'public',
};
}
}
23 changes: 20 additions & 3 deletions source/pages/boardEdit/ui/boardEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,34 @@ import boardEditTemplate from './boardEdit.handlebars';
import './boardEdit.css';
import {View} from '../../../app/View.js';

export class BoardEdit extends View{
/**
* Handle board create and update page
*/
export class BoardEdit extends View {
/**
* Initialize values
* @constructor
* @param {Array} args – arguments to pass into parent class
*/
constructor(...args) {
super(...args);
this.root = document.getElementById('root');
}

renderUpdateBoard(board){
/**
* Render update board page
* @function renderUpdateBoard
* @param {json} board – board info
*/
renderUpdateBoard(board) {
this.root.innerHTML = boardEditTemplate({board});
}

renderCreateBoard(){
/**
* Render create board page
* @function renderCreateBoard
*/
renderCreateBoard() {
this.root.innerHTML = boardEditTemplate({});
}
}
17 changes: 15 additions & 2 deletions source/pages/boardView/ui/boardView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ import boardViewTemplate from './boardView.handlebars';
import './boardView.css';
import {View} from '../../../app/View.js';

export class BoardView extends View{
/**
* Handle board page
*/
export class BoardView extends View {
/**
* Initialize values
* @constructor
* @param {json} args – arguments to pass into parent class
*/
constructor(...args) {
super(...args);
this.root = document.getElementById('root');
}

render(board){
/**
* Render board page
* @function render
* @param {json} board – board info
*/
render(board) {
this.root.innerHTML = boardViewTemplate({board});
}
}
1 change: 1 addition & 0 deletions source/widgets/profileFeed/ui/profileFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class ProfileFeed extends View {
/**
* Render profile feed widget
* @function render
* @param {Array} pins – array of pins with info in each
*/
render(pins) {
this.feed.innerHTML = profileFeedTemplate({pins});
Expand Down

0 comments on commit 21f3d1e

Please sign in to comment.