forked from Mirrors/gomuks
web/timeline: align messages to bottom when the screen isn't full
This commit is contained in:
parent
8d669902d9
commit
dd6c7b4822
2 changed files with 13 additions and 5 deletions
|
@ -1,4 +1,8 @@
|
|||
div.timeline-view {
|
||||
padding: 1rem;
|
||||
overflow-y: scroll;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
|
|
@ -62,11 +62,15 @@ const TimelineView = ({ room }: TimelineViewProps) => {
|
|||
}, [timeline])
|
||||
|
||||
return <div className="timeline-view" onScroll={handleScroll} ref={timelineViewRef}>
|
||||
<button onClick={loadHistory}>Load history</button>
|
||||
{timeline.map(entry => <TimelineEvent
|
||||
key={entry.event_rowid} room={room} eventRowID={entry.event_rowid}
|
||||
/>)}
|
||||
<div ref={bottomRef}/>
|
||||
<div className="timeline-beginning">
|
||||
<button onClick={loadHistory}>Load history</button>
|
||||
</div>
|
||||
<div className="timeline-list">
|
||||
{timeline.map(entry => <TimelineEvent
|
||||
key={entry.event_rowid} room={room} eventRowID={entry.event_rowid}
|
||||
/>)}
|
||||
<div className="timeline-bottom-ref" ref={bottomRef}/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue