2022-06-19 22:08:15 +00:00
|
|
|
import * as tf from './tf.js';
|
|
|
|
|
2022-02-27 02:30:11 +00:00
|
|
|
Vue.component('tf-user', {
|
|
|
|
props: ['id'],
|
|
|
|
computed: {
|
|
|
|
following: {
|
|
|
|
get: function() {
|
2022-06-19 22:08:15 +00:00
|
|
|
return tf.g_data.users?.[tf.g_data.whoami]?.following?.[this.id];
|
2022-02-27 02:30:11 +00:00
|
|
|
},
|
|
|
|
},
|
2022-06-19 22:08:15 +00:00
|
|
|
whoami: { get: function() { return tf.g_data.whoami; } },
|
|
|
|
users: { get: function() { return tf.g_data.users; } },
|
2022-02-27 02:30:11 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
show_user: function() {
|
2022-08-03 23:39:23 +00:00
|
|
|
window.parent.postMessage({
|
|
|
|
action: 'setHash',
|
2022-08-13 19:39:29 +00:00
|
|
|
hash: this.id,
|
2022-08-03 23:39:23 +00:00
|
|
|
}, '*');
|
2022-02-27 02:30:11 +00:00
|
|
|
},
|
|
|
|
},
|
2022-04-14 23:47:41 +00:00
|
|
|
template: `<md-chip :class="following ? 'md-accent' : ''">
|
2022-08-13 19:39:29 +00:00
|
|
|
<a :href="'#' + id" style="color: #fff">{{users[id] && users[id].name ? users[id].name : id}}</a>
|
2022-02-27 02:30:11 +00:00
|
|
|
<md-tooltip v-if="users[id] && users[id].name">{{id}}</md-tooltip>
|
|
|
|
</md-chip>`,
|
|
|
|
});
|