ssb: Expose a list of followed accounts on the profile page. #122
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
This commit is contained in:
parent
e2a231fb4a
commit
9b11c2c629
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"type": "tildefriends-app",
|
"type": "tildefriends-app",
|
||||||
"emoji": "🦀",
|
"emoji": "🦀",
|
||||||
"previous": "&08aLuFwq4TPRG2yO11MDX+2tdKcv1rgc2zLaBCB9fiE=.sha256"
|
"previous": "&klcMVQ9g0ielAoM3WjHRnyWQs4rs8fxmy6PbXIaK2ZU=.sha256"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {LitElement, html, unsafeHTML} from './lit-all.min.js';
|
import {LitElement, html, until, unsafeHTML} from './lit-all.min.js';
|
||||||
import * as tfrpc from '/static/tfrpc.js';
|
import * as tfrpc from '/static/tfrpc.js';
|
||||||
import * as tfutils from './tf-utils.js';
|
import * as tfutils from './tf-utils.js';
|
||||||
import {styles} from './tf-styles.js';
|
import {styles} from './tf-styles.js';
|
||||||
@ -200,6 +200,40 @@ class TfProfileElement extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggle_account_list(event) {
|
||||||
|
let content = event.srcElement.nextElementSibling;
|
||||||
|
if (content.classList.toggle('w3-hide')) {
|
||||||
|
event.srcElement.innerText = 'Show Followed Accounts';
|
||||||
|
} else {
|
||||||
|
event.srcElement.innerText = 'Hide Followed Accounts';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async load_follows() {
|
||||||
|
let accounts = await tfrpc.rpc.following([this.id], 1);
|
||||||
|
return html`
|
||||||
|
<div class="w3-container">
|
||||||
|
<button
|
||||||
|
class="w3-button w3-block w3-theme-d1"
|
||||||
|
@click=${this.toggle_account_list}
|
||||||
|
>
|
||||||
|
Show Followed Accounts
|
||||||
|
</button>
|
||||||
|
<div class="w3-hide w3-card">
|
||||||
|
<ul class="w3-ul w3-theme-d4 w3-border-theme">
|
||||||
|
${Object.keys(accounts).map(
|
||||||
|
(x) => html`
|
||||||
|
<li class="w3-border-theme">
|
||||||
|
<tf-user id=${x} .users=${this.users}></tf-user>
|
||||||
|
</li>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
this.load();
|
this.load();
|
||||||
let self = this;
|
let self = this;
|
||||||
@ -314,6 +348,7 @@ class TfProfileElement extends LitElement {
|
|||||||
Blocked by ${profile.blocked} identities.
|
Blocked by ${profile.blocked} identities.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
${until(this.load_follows(), html`<p>Loading accounts followed...</p>`)}
|
||||||
<footer class="w3-container">
|
<footer class="w3-container">
|
||||||
<p>
|
<p>
|
||||||
${edit}
|
${edit}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user