mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
feat: make WelcomeHero extensible (#3848)
* chore: make WelcomeHero extensible * undo import mithril change * reduce to one itemlist
This commit is contained in:
@@ -2,6 +2,7 @@ import app from '../app';
|
||||
import Component from '../../common/Component';
|
||||
import Button from '../../common/components/Button';
|
||||
import type Mithril from 'mithril';
|
||||
import ItemList from '../../common/utils/ItemList';
|
||||
|
||||
export interface IWelcomeHeroAttrs {}
|
||||
|
||||
@@ -39,8 +40,7 @@ export default class WelcomeHero extends Component<IWelcomeHeroAttrs> {
|
||||
/>
|
||||
|
||||
<div className="containerNarrow">
|
||||
<h1 className="Hero-title">{app.forum.attribute('welcomeTitle')}</h1>
|
||||
<div className="Hero-subtitle">{m.trust(app.forum.attribute('welcomeMessage'))}</div>
|
||||
{this.welcomeItems().toArray()}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -66,4 +66,13 @@ export default class WelcomeHero extends Component<IWelcomeHeroAttrs> {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
welcomeItems(): ItemList<Mithril.Children> {
|
||||
const items = new ItemList<Mithril.Children>();
|
||||
|
||||
items.add('hero-title', <h1 className="Hero-title">{app.forum.attribute('welcomeTitle')}</h1>, 20);
|
||||
items.add('hero-subtitle', <div className="Hero-subtitle">{m.trust(app.forum.attribute('welcomeMessage'))}</div>, 10);
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user