import Component from 'flarum/Component'; import Button from 'flarum/components/Button'; /** * The `WelcomeHero` component displays a hero that welcomes the user to the * forum. */ export default class WelcomeHero extends Component { constructor(...args) { super(...args); this.hidden = localStorage.getItem('welcomeHidden'); } view() { if (this.hidden) return
; const slideUp = () => { this.$().slideUp(this.hide.bind(this)); }; return (
{Button.component({ icon: 'times', onclick: slideUp, className: 'Hero-close Button Button--icon Button--link' })}

{app.forum.attribute('welcomeTitle')}

{m.trust(app.forum.attribute('welcomeMessage'))}
); } /** * Hide the welcome hero. */ hide() { localStorage.setItem('welcomeHidden', 'true'); this.hidden = true; } }