forked from MapComplete/MapComplete
Cleanup of review-css to use tailwind
This commit is contained in:
parent
9cb3a49b28
commit
a76d8822ff
7 changed files with 52 additions and 108 deletions
|
@ -12,7 +12,7 @@ import SingleReview from "./SingleReview";
|
|||
export default class ReviewElement extends UIElement {
|
||||
private readonly _reviews: UIEventSource<Review[]>;
|
||||
private readonly _subject: string;
|
||||
private _middleElement: UIElement;
|
||||
private readonly _middleElement: UIElement;
|
||||
|
||||
constructor(subject: string, reviews: UIEventSource<Review[]>, middleElement: UIElement) {
|
||||
super(reviews);
|
||||
|
@ -34,7 +34,7 @@ export default class ReviewElement extends UIElement {
|
|||
const avg = (revs.map(review => review.rating).reduce((a, b) => a + b, 0) / revs.length);
|
||||
elements.push(
|
||||
new Combine([
|
||||
SingleReview.GenStars(avg).SetClass("stars flex"),
|
||||
SingleReview.GenStars(avg),
|
||||
`<a target="_blank" href='https://mangrove.reviews/search?sub=${encodeURIComponent(this._subject)}'>`,
|
||||
revs.length === 1 ? Translations.t.reviews.title_singular :
|
||||
Translations.t.reviews.title
|
||||
|
@ -43,7 +43,7 @@ export default class ReviewElement extends UIElement {
|
|||
"</a>"
|
||||
])
|
||||
|
||||
.SetClass("review-title"));
|
||||
.SetClass("font-2xl flex justify-between items-center pl-2 pr-2"));
|
||||
|
||||
elements.push(this._middleElement);
|
||||
|
||||
|
@ -56,7 +56,7 @@ export default class ReviewElement extends UIElement {
|
|||
|
||||
.SetClass("review-attribution"))
|
||||
|
||||
return new Combine(elements).SetClass("review").Render();
|
||||
return new Combine(elements).SetClass("block").Render();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue