componentize user info

This commit is contained in:
Ginger Wong
2020-06-28 17:15:53 -07:00
parent 6c7af9ffae
commit b228d3a4e5
5 changed files with 62 additions and 43 deletions

View File

@@ -11,6 +11,7 @@ async function setupApp() {
messages: [],
extraUserContent: "",
isOnline: false,
layout: "desktop",
// from config
logo: null,
socialHandles: [],

View File

@@ -2,7 +2,7 @@ Vue.component('owncast-footer', {
props: {
appVersion: {
type: String,
default: "0.1",
default: '0.1',
},
},
@@ -32,4 +32,28 @@ Vue.component('stream-tags', {
</li>
</ul>
`,
});
});
Vue.component('user-details', {
props: ['logo', 'platforms', 'summary', 'tags', 'extraContent'],
template: `
<div class="user-content">
<div class="user-image rounded-full bg-white">
<img class="logo" alt="Logo" v-bind:src="logo">
</div>
<div class="user-content-header border-b border-gray-500 border-solid">
<h2 class="font-semibold">
About <span class="streamer-name text-indigo-600">
<slot></slot>
</span>
</h2>
<social-list v-bind:platforms="platforms"></social-list>
<div class="stream-summary" v-html="summary"></div>
<stream-tags v-bind:tags="tags"></stream-tags>
</div>
<div v-html="extraContent"></div>
</div>
`,
});

View File

@@ -78,10 +78,13 @@ class Messaging {
if (hasTouchScreen()) {
this.scrollableMessagesContainer = document.body;
this.tagAppContainer.classList.add("touch-screen");
window.app.layout = "touch";
window.onorientationchange = this.handleOrientationChange.bind(this);
this.handleOrientationChange();
} else {
this.tagAppContainer.classList.add("desktop");
window.app.layout = "desktop";
}
}