favorites lol

This commit is contained in:
Flummi
2022-01-02 06:52:52 +01:00
parent e8ff4396aa
commit e72b86c981
5 changed files with 44 additions and 8 deletions

View File

@ -81,7 +81,6 @@ const flash = ({ type, msg }) => {
_tags.reverse().forEach(tag => {
const a = document.createElement("a");
a.href = `/tag/${tag.tag}`;
a.target = "_blank";
a.style = "color: inherit !important";
a.innerHTML = tag.tag;
@ -207,7 +206,23 @@ const flash = ({ type, msg }) => {
// span#favs
const favcontainer = document.querySelector('span#favs');
favcontainer.innerHTML = "favorites:" + JSON.stringify(Object.values(res.favs));
favcontainer.innerHTML = "";
res.favs.forEach(f => {
const a = document.createElement('a');
a.href = `/user/${f.user}/favs`;
a.setAttribute('tooltip', f.user);
a.setAttribute('flow', 'down');
const img = document.createElement('img');
img.src = `/t/${f.avatar}.png`;
img.style.height = "32px";
img.style.width = "32px";
a.insertAdjacentElement('beforeend', img);
favcontainer.insertAdjacentElement('beforeend', a);
favcontainer.innerHTML += " ";
});
}
else {
// lul