mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-22 11:22:59 +03:00
app store widget fix
This commit is contained in:
parent
3862e6fb78
commit
888599a722
@ -100,26 +100,28 @@ fn make_widget() -> String {
|
||||
.then(data => {
|
||||
const container = document.getElementById('latest-apps');
|
||||
data.forEach(app => {
|
||||
const a = document.createElement('a');
|
||||
a.className = 'app p-2 grow flex items-stretch rounded-lg shadow bg-white/10 hover:bg-white/20 font-sans cursor-pointer';
|
||||
a.href = `/main:app_store:sys/app-details/${app.package}:${app.publisher}`
|
||||
a.target = '_blank';
|
||||
a.rel = 'noopener noreferrer';
|
||||
const iconLetter = app.metadata_hash.replace('0x', '')[0].toUpperCase();
|
||||
a.innerHTML = `<div
|
||||
class="app-image rounded mr-2 grow"
|
||||
style="
|
||||
background-image: url('${app.metadata.image || `/icons/${iconLetter}`}');
|
||||
height: 92px;
|
||||
width: 92px;
|
||||
max-width: 33%;
|
||||
"
|
||||
></div>
|
||||
<div class="app-info flex flex-col grow">
|
||||
<h2 class="font-bold">${app.metadata.name}</h2>
|
||||
<p>${app.metadata.description}</p>
|
||||
</div>`;
|
||||
container.appendChild(a);
|
||||
if (app.metadata) {
|
||||
const a = document.createElement('a');
|
||||
a.className = 'app p-2 grow flex items-stretch rounded-lg shadow bg-white/10 hover:bg-white/20 font-sans cursor-pointer';
|
||||
a.href = `/main:app_store:sys/app-details/${app.package}:${app.publisher}`
|
||||
a.target = '_blank';
|
||||
a.rel = 'noopener noreferrer';
|
||||
const iconLetter = app.metadata_hash.replace('0x', '')[0].toUpperCase();
|
||||
a.innerHTML = `<div
|
||||
class="app-image rounded mr-2 grow"
|
||||
style="
|
||||
background-image: url('${app.metadata.image || `/icons/${iconLetter}`}');
|
||||
height: 92px;
|
||||
width: 92px;
|
||||
max-width: 33%;
|
||||
"
|
||||
></div>
|
||||
<div class="app-info flex flex-col grow">
|
||||
<h2 class="font-bold">${app.metadata.name}</h2>
|
||||
<p>${app.metadata.description}</p>
|
||||
</div>`;
|
||||
container.appendChild(a);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error fetching apps:', error));
|
||||
|
Loading…
Reference in New Issue
Block a user