Sprint 19: Social, UX-Verbesserungen, Nerd2Noob-Hilfe
This commit is contained in:
parent
10d30bf565
commit
89d87030a2
18 changed files with 930 additions and 74 deletions
|
|
@ -366,19 +366,15 @@ window.Page_friends = (() => {
|
|||
const el = _container.querySelector('#fr-list');
|
||||
|
||||
if (!list.length) {
|
||||
el.innerHTML = `
|
||||
<div style="text-align:center;padding:var(--space-10) var(--space-4)">
|
||||
<svg class="ph-icon" style="width:48px;height:48px;color:var(--c-border);
|
||||
margin-bottom:var(--space-3)" aria-hidden="true">
|
||||
<use href="/icons/phosphor.svg#paw-print"></use>
|
||||
</svg>
|
||||
<p style="font-size:var(--text-base);font-weight:var(--weight-semibold);
|
||||
color:var(--c-text);margin:0 0 var(--space-2)">Noch keine Hundefreunde</p>
|
||||
<p style="font-size:var(--text-sm);color:var(--c-text-secondary);margin:0">
|
||||
Suche oben nach anderen Hundebesitzern und schick ihnen eine Anfrage.
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
el.innerHTML = _emptyState(
|
||||
'users-three',
|
||||
'Noch keine Freunde',
|
||||
'Verbinde dich mit anderen Hundebesitzern. Teile Routen, sieh Aktivitäten und schreib Nachrichten.',
|
||||
`<button class="btn btn-primary" id="fr-empty-search">Freunde suchen</button>`
|
||||
);
|
||||
el.querySelector('#fr-empty-search')?.addEventListener('click', () => {
|
||||
_container.querySelector('#fr-search')?.focus();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -774,6 +770,17 @@ window.Page_friends = (() => {
|
|||
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
||||
}
|
||||
|
||||
function _emptyState(icon, title, text, cta = '') {
|
||||
return `<div class="empty-state">
|
||||
<svg class="ph-icon empty-state-icon" aria-hidden="true">
|
||||
<use href="/icons/phosphor.svg#${icon}"></use>
|
||||
</svg>
|
||||
<div class="empty-state-title">${title}</div>
|
||||
${text ? `<p class="empty-state-text">${text}</p>` : ''}
|
||||
${cta ? `<div class="empty-state-cta">${cta}</div>` : ''}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
return { init, refresh, onDogChange, _accept, _decline, _cancel, _removeFriend, _openChat };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue