forked from HackYourFuture/JavaScript3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRepository.js
More file actions
25 lines (22 loc) · 987 Bytes
/
Copy pathRepository.js
File metadata and controls
25 lines (22 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
/* global Util */
// eslint-disable-next-line no-unused-vars
class Repository {
constructor(data){
this._data = data;
}
/**
* Render the repository info to the DOM.
* @param {HTMLElement} parent The parent element in which to render the repository.
*/
render(){
const repositoriesInfoElement = document.querySelector('#repo_info');
repositoriesInfoElement.innerHTML =``;
repositoriesInfoElement.innerHTML =`<div class="repoContainer">
<strong>Repository: </strong><span><a href=${this._data.html_url}>${this._data.name}</a></span><br>
<strong>Description: </strong><span>${this._data.description}</span><br>
<strong>Forks: </strong><span>${this._data.forks}</span><br>
<strong>Updated: </strong><span>${this._data.updated_at}</span><br>
</div>`;
}
}