index => ssb

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3849 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-02-27 02:30:11 +00:00
parent 011038a38a
commit c138582638
15 changed files with 13353 additions and 1 deletions

25
apps/cory/ssb/tf-user.js Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Vue.component('tf-user', {
props: ['id'],
computed: {
following: {
get: function() {
return g_data.users &&
g_data.users[g_data.whoami] &&
g_data.users[g_data.whoami].following &&
g_data.users[g_data.whoami].following[this.id];
},
},
whoami: { get: function() { return g_data.whoami; } },
users: { get: function() { return g_data.users; } },
},
methods: {
show_user: function() {
window.parent.postMessage({action: 'setHash', hash: this.id}, '*');
},
},
template: `<md-chip md-clickable :class="following ? 'md-accent' : ''" @click="show_user()">
{{users[id] && users[id].name ? users[id].name : id}}
<md-tooltip v-if="users[id] && users[id].name">{{id}}</md-tooltip>
</md-chip>`,
});