v0.9.3 added user feature to disable participation in private messages
This commit is contained in:
@@ -97,34 +97,46 @@ export default function UserProfilePopup({ user: profileUser, anchorEl, onClose,
|
||||
</p>
|
||||
)}
|
||||
{!isSelf && onDirectMessage && (
|
||||
<button
|
||||
onClick={handleDM}
|
||||
disabled={starting}
|
||||
style={{
|
||||
marginTop: 6,
|
||||
width: '100%',
|
||||
padding: '8px 0',
|
||||
borderRadius: 'var(--radius)',
|
||||
border: '1px solid var(--primary)',
|
||||
background: 'transparent',
|
||||
color: 'var(--primary)',
|
||||
fontSize: 13,
|
||||
fontWeight: 600,
|
||||
cursor: starting ? 'default' : 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: 6,
|
||||
transition: 'background var(--transition), color var(--transition)',
|
||||
}}
|
||||
onMouseEnter={e => { e.currentTarget.style.background = 'var(--primary)'; e.currentTarget.style.color = 'white'; }}
|
||||
onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--primary)'; }}
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||
</svg>
|
||||
{starting ? 'Opening...' : 'Direct Message'}
|
||||
</button>
|
||||
profileUser.allow_dm === 0 ? (
|
||||
<p style={{
|
||||
marginTop: 8,
|
||||
textAlign: 'center',
|
||||
fontSize: 12,
|
||||
color: 'var(--text-tertiary)',
|
||||
fontStyle: 'italic',
|
||||
}}>
|
||||
DMs disabled by user
|
||||
</p>
|
||||
) : (
|
||||
<button
|
||||
onClick={handleDM}
|
||||
disabled={starting}
|
||||
style={{
|
||||
marginTop: 6,
|
||||
width: '100%',
|
||||
padding: '8px 0',
|
||||
borderRadius: 'var(--radius)',
|
||||
border: '1px solid var(--primary)',
|
||||
background: 'transparent',
|
||||
color: 'var(--primary)',
|
||||
fontSize: 13,
|
||||
fontWeight: 600,
|
||||
cursor: starting ? 'default' : 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: 6,
|
||||
transition: 'background var(--transition), color var(--transition)',
|
||||
}}
|
||||
onMouseEnter={e => { e.currentTarget.style.background = 'var(--primary)'; e.currentTarget.style.color = 'white'; }}
|
||||
onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--primary)'; }}
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||
</svg>
|
||||
{starting ? 'Opening...' : 'Direct Message'}
|
||||
</button>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user