mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 12:04:16 +00:00
added compact mode
This commit is contained in:
parent
96238ee018
commit
e6763b4cc6
@ -336,23 +336,34 @@ export default class LiveChat extends React.Component {
|
|||||||
return <div
|
return <div
|
||||||
className={classnames(
|
className={classnames(
|
||||||
"liveChat",
|
"liveChat",
|
||||||
{ ["empty"]: this.state.timeline.length === 0 }
|
{
|
||||||
|
["empty"]: this.state.timeline.length === 0,
|
||||||
|
["compact"]: this.props.compact
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
this.state.timeline.length === 0 ?
|
!this.props.compact && this.state.timeline.length === 0 && <antd.Empty description="Welcome to the room" />
|
||||||
<antd.Empty description="Welcome to the room" /> :
|
}
|
||||||
<div
|
|
||||||
className="liveChat_timeline"
|
{
|
||||||
ref={this.timelineRef}
|
this.props.compact && this.state.timeline.length === 0 && <p>
|
||||||
id="liveChat_timeline"
|
Welcome to the room
|
||||||
>
|
</p>
|
||||||
{
|
}
|
||||||
this.state.timeline.map((line, index) => {
|
|
||||||
return <Line key={index} {...line} />
|
{
|
||||||
})
|
this.state.timeline.length !== 0 && <div
|
||||||
}
|
className="liveChat_timeline"
|
||||||
</div>
|
ref={this.timelineRef}
|
||||||
|
id="liveChat_timeline"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
this.state.timeline.map((line, index) => {
|
||||||
|
return <Line key={index} {...line} />
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className="liveChat_textInput">
|
<div className="liveChat_textInput">
|
||||||
|
@ -9,9 +9,53 @@
|
|||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
transition: all 250ms ease-in-out;
|
||||||
|
|
||||||
&.empty {
|
&.empty {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
&.compact {
|
||||||
|
height: 5vh!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.compact {
|
||||||
|
height: 15vh;
|
||||||
|
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
.liveChat_timeline {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
gap: 5px;
|
||||||
|
|
||||||
|
.textRoom_line {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.liveChat_textInput {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.floating {
|
&.floating {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user