luceos
Oops..here it is:
import app from 'flarum/forum/app';
import Component from 'flarum/common/Component';
import Link from 'flarum/common/components/Link';
import Avatar from 'flarum/common/helpers/avatar';
import TagsLabel from 'flarum/tags/helpers/tagsLabel';
export default class AddVideoGallery extends Component {
oninit(vnode) {
super.oninit(vnode);
this.megaNoob = [];
this.loading = true;
}
oncreate(vnode) {
super.oncreate(vnode);
app.store
.find("discussions", {
filter: {
type: 'discussion',
q: 'youtube',
include:'firstPost,user,tags'
},
page: {limit: 3},
sort: '-createdAt',
})
.then((results) => {
this.megaNoob = results;
this.loading = false;
m.redraw();
});
}
view() {
return(
<div className="cardContainer2">
<section className="cards-wrapper2">
{this.megaNoob &&
this.megaNoob.map((disco)=> {
return (
<div className="card-grid-space2">
<Link className="card2" href={app.route.discussion(disco)}>
{m.trust(
disco
.firstPost()
.contentHtml()
)}
</Link>
<div><a href={app.route.discussion(disco)} style="font-size:18px">Go To Discussion</a></div>
</div>
);
})}
</section>
</div>
)
}
}
Okay, so explain what I have attempted:
view() {
var insert = 'Hello, world';
return(
<div className="cardContainer2">
<section className="cards-wrapper2">
{this.megaNoob &&
this.megaNoob.splice(1,0,insert) &&
this.megaNoob.map((disco)=> {
and
var insert = 'Hello World';
var thisNoob = Array.from(this.megaNoob);
thisNoob.splice(1,0,insert);
return(
<div className="cardContainer2">
<section className="cards-wrapper2">
{thisNoob &&
thisNoob.map((disco)=> {
This inserts the text into the array....but the view is blank.