pinafore/routes/_components/Timeline.html
2018-01-14 21:41:19 -08:00

48 lines
1 KiB
HTML

<ul>
{{#each statuses as status}}
<li>
<Status :status />
</li>
{{/each}}
</ul>
<style>
ul {
list-style: none;
padding-right: 10px;
}
li {
border-bottom: 1px solid var(--main-border);
}
</style>
<script>
import { store } from '../_utils/store'
import { getHomeTimeline } from '../_utils/mastodon/oauth'
import fixture from '../_utils/fixture.json'
import Status from './Status.html'
export default {
oncreate: async function () {
if (!process.browser) {
return
}
let instanceData = this.store.get('currentInstance')
if (!instanceData) {
return
}
let response = fixture
// let response = await (await getHomeTimeline(instanceData.instanceName, instanceData.access_token)).json()
if (process.env.NODE_ENV !== 'production') {
console.log(response)
}
this.set({'statuses': response})
},
data: () => ({
target: 'home',
statuses: []
}),
store: () => store,
components: {
Status
}
}
</script>