1
0
Fork 0
forked from Mirrors/gomuks

web/rightpanel: center no pinned messages text

This commit is contained in:
Tulir Asokan 2024-10-31 00:21:23 +02:00
parent 54234036a7
commit f9b94034b1
2 changed files with 8 additions and 6 deletions

View file

@ -42,14 +42,12 @@ const PinnedMessages = () => {
if (!roomCtx) { if (!roomCtx) {
return null return null
} else if (!Array.isArray(pins?.pinned) || pins.pinned.length === 0) { } else if (!Array.isArray(pins?.pinned) || pins.pinned.length === 0) {
return <>No pinned messages</> return <div className="empty">No pinned messages</div>
} }
return <> return <>
<RoomContext value={roomCtx}>
{reverseMap(pins.pinned, evtID => typeof evtID === "string" ? <div className="pinned-event" key={evtID}> {reverseMap(pins.pinned, evtID => typeof evtID === "string" ? <div className="pinned-event" key={evtID}>
<PinnedMessage evtID={evtID} room={roomCtx.store} /> <PinnedMessage evtID={evtID} room={roomCtx.store} />
</div> : null)} </div> : null)}
</RoomContext>
</> </>
} }

View file

@ -39,4 +39,8 @@ div.right-panel-content.pinned-messages {
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
padding-bottom: .5rem; padding-bottom: .5rem;
} }
> div.empty {
margin: auto;
}
} }