2020-09-21 01:19:12 +02:00
|
|
|
const html = require('choo/html');
|
2019-10-28 07:02:45 +01:00
|
|
|
|
2020-09-21 01:19:12 +02:00
|
|
|
const aboutView = (state, emit, i18n) => {
|
2019-10-28 07:02:45 +01:00
|
|
|
const content = html`<section class="content"><i class="icon-loading animate-spin"></i></section>`;
|
|
|
|
const community = html`<section class="content"></section>`;
|
|
|
|
|
|
|
|
const promises = [];
|
|
|
|
if (typeof i18n.pages.about === 'undefined' || typeof i18n.pages.community === 'undefined') {
|
|
|
|
promises.push(i18n.fetchLocalePage('about'));
|
|
|
|
promises.push(i18n.fetchLocalePage('community'));
|
|
|
|
} else {
|
|
|
|
content.innerHTML = i18n.pages.about;
|
|
|
|
community.innerHTML = i18n.pages.community;
|
|
|
|
}
|
|
|
|
if (promises.length > 0) {
|
2020-09-16 22:16:50 +02:00
|
|
|
Promise.all(promises).then(fulfilled => emit(state.events.RENDER));
|
2019-10-28 07:02:45 +01:00
|
|
|
}
|
|
|
|
return [
|
|
|
|
content,
|
|
|
|
community,
|
|
|
|
];
|
2020-09-21 01:19:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = { aboutView };
|