v0.11.26 new rules for default admin user

This commit is contained in:
2026-03-22 18:51:46 -04:00
parent 25a9fa4a02
commit 21dc788cd3
8 changed files with 42 additions and 15 deletions

View File

@@ -76,17 +76,19 @@ export default function ProfileModal({ onClose }) {
<div className="flex items-center gap-3" style={{ gap: 16, marginBottom: 20 }}>
<div style={{ position: 'relative' }}>
<Avatar user={user} size="xl" />
<label title="Change avatar" style={{
position: 'absolute', bottom: 0, right: 0,
background: 'var(--primary)', color: 'white', borderRadius: '50%',
width: 24, height: 24, display: 'flex', alignItems: 'center', justifyContent: 'center',
cursor: 'pointer', fontSize: 12
}}>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
<input type="file" accept="image/*"
style={{ opacity: 0, position: 'absolute', width: '100%', height: '100%', top: 0, left: 0, cursor: 'pointer' }}
onChange={handleAvatarUpload} />
</label>
{!user?.is_default_admin && (
<label title="Change avatar" style={{
position: 'absolute', bottom: 0, right: 0,
background: 'var(--primary)', color: 'white', borderRadius: '50%',
width: 24, height: 24, display: 'flex', alignItems: 'center', justifyContent: 'center',
cursor: 'pointer', fontSize: 12
}}>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
<input type="file" accept="image/*"
style={{ opacity: 0, position: 'absolute', width: '100%', height: '100%', top: 0, left: 0, cursor: 'pointer' }}
onChange={handleAvatarUpload} />
</label>
)}
</div>
<div>
<div style={{ fontWeight: 600, fontSize: 16 }}>{user?.display_name || user?.name}</div>