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 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user