1
0
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:
IanM
2023-07-27 11:27:00 +01:00
committed by GitHub
parent ce334156d5
commit e014aa0105

View File

@@ -2,6 +2,7 @@ import app from '../app';
import Component from '../../common/Component'; import Component from '../../common/Component';
import Button from '../../common/components/Button'; import Button from '../../common/components/Button';
import type Mithril from 'mithril'; import type Mithril from 'mithril';
import ItemList from '../../common/utils/ItemList';
export interface IWelcomeHeroAttrs {} export interface IWelcomeHeroAttrs {}
@@ -39,8 +40,7 @@ export default class WelcomeHero extends Component<IWelcomeHeroAttrs> {
/> />
<div className="containerNarrow"> <div className="containerNarrow">
<h1 className="Hero-title">{app.forum.attribute('welcomeTitle')}</h1> {this.welcomeItems().toArray()}
<div className="Hero-subtitle">{m.trust(app.forum.attribute('welcomeMessage'))}</div>
</div> </div>
</div> </div>
</header> </header>
@@ -66,4 +66,13 @@ export default class WelcomeHero extends Component<IWelcomeHeroAttrs> {
return false; 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;
}
} }