UNPKG

734 BJavaScriptView Raw
1'use strict';
2
3const ConceptImagePresenter = require('./concept-image');
4const ResponsiveGridsPresenter = require('./responsive-grids');
5
6/**
7* Combine both presenters for use with concepts
8* @param {Object} items - see ConceptImagePresenter
9* @param {Object} show - see ResponsiveGridsPresenter
10**/
11class ConceptPresenter {
12 constructor (data) {
13 this.data = data;
14 }
15 get imageUrl () {
16 if (this.data) {
17 const image = new ConceptImagePresenter({
18 items: this.data.items
19 });
20 return image.imageUrl;
21 }
22 }
23 get responsiveGrids () {
24 if (this.data && this.data.show) {
25 const rgrids = new ResponsiveGridsPresenter({show: this.data.show});
26 return rgrids.responsiveGrids;
27 }
28 }
29}
30
31module.exports = ConceptPresenter;