1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02:00

Replace Ember app with Mithril app

This commit is contained in:
Toby Zerner
2015-04-25 22:28:39 +09:30
parent 6f67b8c247
commit b68a4711dc
377 changed files with 5641 additions and 7330 deletions

View File

@@ -0,0 +1,32 @@
import Component from 'flarum/component';
export default class WelcomeHero extends Component {
constructor(props) {
super(props);
this.title = m.prop('Mithril Forum')
this.description = m.prop('Hello')
this.hidden = m.prop(localStorage.getItem('welcomeHidden'))
}
hide() {
localStorage.setItem('welcomeHidden', 'true')
this.hidden(true)
}
view() {
var root = m.prop()
var self = this;
return this.hidden() ? m('') : m('header.hero.welcome-hero', {config: root}, [
m('div.container', [
m('button.close.btn.btn-icon.btn-link', {onclick: function() {
$(root()).slideUp(self.hide.bind(self))
}}, m('i.fa.fa-times')),
m('div.container-narrow', [
m('h2', this.title()),
m('p', this.description())
])
])
])
}
}