diff --git a/source/app/App.js b/source/app/App.js index 450bd94a..aa955f8a 100644 --- a/source/app/App.js +++ b/source/app/App.js @@ -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'; @@ -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(); diff --git a/source/app/View.js b/source/app/View.js index 0bdaac8e..c8c7fdd5 100644 --- a/source/app/View.js +++ b/source/app/View.js @@ -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', + }; } } diff --git a/source/pages/boardEdit/ui/boardEdit.js b/source/pages/boardEdit/ui/boardEdit.js index 09d9bb85..35adc052 100644 --- a/source/pages/boardEdit/ui/boardEdit.js +++ b/source/pages/boardEdit/ui/boardEdit.js @@ -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({}); } } diff --git a/source/pages/boardView/ui/boardView.js b/source/pages/boardView/ui/boardView.js index c73fe9fc..783d4c76 100644 --- a/source/pages/boardView/ui/boardView.js +++ b/source/pages/boardView/ui/boardView.js @@ -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}); } } diff --git a/source/widgets/profileFeed/ui/profileFeed.js b/source/widgets/profileFeed/ui/profileFeed.js index 9554c4ac..6613d2c2 100644 --- a/source/widgets/profileFeed/ui/profileFeed.js +++ b/source/widgets/profileFeed/ui/profileFeed.js @@ -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});