28
src/components/api-info-component/ApiInfoComponent.js
Normal file
28
src/components/api-info-component/ApiInfoComponent.js
Normal file
@ -0,0 +1,28 @@
|
||||
import Component from '../component/index';
|
||||
|
||||
import './ApiInfoComponent.css';
|
||||
|
||||
class ApiInfoComponent extends Component {
|
||||
constructor (container) {
|
||||
super('#api-info', container);
|
||||
|
||||
this.infoTitle = this.mainNode.querySelector('.Info__title');
|
||||
this.infoSidebar = this.mainNode.querySelector('.Info__sidebar');
|
||||
this.infoEditor = this.mainNode.querySelector('.Info__editor');
|
||||
this.infoFooter = this.mainNode.querySelector('.Info__footer');
|
||||
}
|
||||
|
||||
render = (object, index) => {
|
||||
this.object = object;
|
||||
this.index = index;
|
||||
|
||||
if (this.object) {
|
||||
this.infoTitle.textContent = this.object.key ;
|
||||
this.infoSidebar.textContent = this.object.description;
|
||||
this.infoEditor.textContent = this.object.value;
|
||||
this.infoFooter.textContent = this.object.author;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
export default ApiInfoComponent;
|
||||
Reference in New Issue
Block a user