Add quickfacts-box to wikipedia article

This commit is contained in:
Pieter Vander Vennet 2021-10-18 20:40:24 +02:00
parent c1d21fcbe5
commit 902f32ba4b
14 changed files with 343 additions and 50 deletions

View file

@ -182,6 +182,7 @@ export default class WikipediaBox extends Combine {
language: language
})
const wp = Translations.t.general.wikipedia
const quickFacts = WikidataPreviewBox.QuickFacts(wikidata);
const contents: UIEventSource<string | BaseUIElement> = htmlContent.map(htmlContent => {
if (htmlContent === undefined) {
// Still loading
@ -198,7 +199,9 @@ export default class WikipediaBox extends Combine {
return undefined
})
return new Combine([new VariableUiElement(contents)
return new Combine([
quickFacts?.SetClass("border-2 border-grey rounded-lg m-1 mb-0"),
new VariableUiElement(contents)
.SetClass("block pl-6 pt-2")])
}