web/rightpanel: improve error style in user view

This commit is contained in:
Tulir Asokan 2024-12-05 16:07:14 +02:00
parent 72dab88ed2
commit 785f20c7dc
2 changed files with 27 additions and 1 deletions

View file

@ -167,6 +167,27 @@ div.right-panel-content.user {
} }
} }
} }
div.errors {
display: flex;
flex-direction: column;
gap: .5rem;
> div.error {
display: flex;
gap: .25rem;
> p {
margin: 0;
}
> div.icon {
margin-top: .125rem;
color: var(--error-color);
flex-shrink: 0;
}
}
}
} }
div.right-panel-content.members { div.right-panel-content.members {

View file

@ -27,6 +27,7 @@ import { RoomContext } from "../roomview/roomcontext.ts"
import EncryptedOffIcon from "@/icons/encrypted-off.svg?react" import EncryptedOffIcon from "@/icons/encrypted-off.svg?react"
import EncryptedQuestionIcon from "@/icons/encrypted-question.svg?react" import EncryptedQuestionIcon from "@/icons/encrypted-question.svg?react"
import EncryptedIcon from "@/icons/encrypted.svg?react" import EncryptedIcon from "@/icons/encrypted.svg?react"
import ErrorIcon from "@/icons/error.svg?react"
interface UserInfoProps { interface UserInfoProps {
userID: UserID userID: UserID
@ -79,7 +80,10 @@ function renderErrors(errors: string[]) {
if (!errors.length) { if (!errors.length) {
return null return null
} }
return <div className="error">{errors.map((err, i) => <p key={i}>{err}</p>)}</div> return <div className="errors">{errors.map((err, i) => <div className="error" key={i}>
<div className="icon"><ErrorIcon /></div>
<p>{err}</p>
</div>)}</div>
} }
function renderFullInfo( function renderFullInfo(
@ -156,6 +160,7 @@ const DeviceList = ({ view, room }: DeviceListProps) => {
<h4>Security</h4> <h4>Security</h4>
<p>{encryptionMessage}</p> <p>{encryptionMessage}</p>
<p>This user's device list is not being tracked.</p> <p>This user's device list is not being tracked.</p>
<hr/>
</div> </div>
} }
let verifiedMessage = null let verifiedMessage = null