Fix: hidden-Button Farben korrigiert
This commit is contained in:
@@ -1712,17 +1712,23 @@ function UserManagement({ toast }) {
|
|||||||
style={{...S.btn('#ffe66d',true),fontSize:10}}>🔑 PW</button>
|
style={{...S.btn('#ffe66d',true),fontSize:10}}>🔑 PW</button>
|
||||||
<button
|
<button
|
||||||
onClick={async ()=>{
|
onClick={async ()=>{
|
||||||
|
if (u.role==='admin') return;
|
||||||
try {
|
try {
|
||||||
const r = await api(`/admin/users/${u.id}/hidden`,{method:'PUT'});
|
const r = await api(`/admin/users/${u.id}/hidden`,{method:'PUT'});
|
||||||
setUsers(p=>p.map(x=>x.id===u.id?{...x,hidden:r.hidden}:x));
|
setUsers(p=>p.map(x=>x.id===u.id?{...x,hidden:r.hidden}:x));
|
||||||
toast(r.hidden ? 'Benutzer ausgeblendet' : 'Benutzer wieder sichtbar');
|
toast(r.hidden ? 'Benutzer ausgeblendet' : 'Benutzer wieder sichtbar');
|
||||||
} catch(e){ toast(e.message,'error'); }
|
} catch(e){ toast(e.message,'error'); }
|
||||||
}}
|
}}
|
||||||
title={u.hidden ? 'Für andere Benutzer unsichtbar – klicken zum Einblenden' : 'Für andere Benutzer sichtbar – klicken zum Ausblenden'}
|
title={u.role==='admin'?'Admin kann nicht ausgeblendet werden':u.hidden?'Einblenden':'Ausblenden'}
|
||||||
style={{...S.btn(u.hidden?'#ffe66d':'rgba(255,255,255,0.3)',true),fontSize:10,
|
disabled={u.role==='admin'}
|
||||||
opacity: u.role==='admin'?0.4:1,
|
style={{
|
||||||
cursor: u.role==='admin'?'not-allowed':'pointer'}}>
|
fontSize:10, fontFamily:'monospace', cursor: u.role==='admin'?'not-allowed':'pointer',
|
||||||
{u.hidden ? '👁 einblenden' : '👁 ausblenden'}
|
padding:'3px 8px', borderRadius:6, border:'none',
|
||||||
|
background: u.hidden ? 'rgba(255,230,109,0.15)' : 'rgba(255,255,255,0.08)',
|
||||||
|
color: u.hidden ? '#ffe66d' : 'rgba(255,255,255,0.5)',
|
||||||
|
opacity: u.role==='admin' ? 0.3 : 1,
|
||||||
|
}}>
|
||||||
|
{u.hidden ? '👁 einblend.' : '👁 ausblend.'}
|
||||||
</button>
|
</button>
|
||||||
<button onClick={()=>del(u.id)} style={{...S.btn('#ff6b9d',true)}}>
|
<button onClick={()=>del(u.id)} style={{...S.btn('#ff6b9d',true)}}>
|
||||||
<TrashIcon size={13} color="#ff6b9d"/>
|
<TrashIcon size={13} color="#ff6b9d"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user