|
|
|
@ -19,44 +19,20 @@ const Input = require('./components/input.js')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let backend = new Matrix("user", "pass", "http://localhost")
|
|
|
|
|
backend.sync()
|
|
|
|
|
|
|
|
|
|
let App = create({
|
|
|
|
|
displayName: "App",
|
|
|
|
|
|
|
|
|
|
getInitialState: function() {
|
|
|
|
|
setTimeout(this.newEvent, 5000)
|
|
|
|
|
return {
|
|
|
|
|
events: [
|
|
|
|
|
{sender: "Foks", content: "Hello"},
|
|
|
|
|
{sender: "Foks", content: "This is Neo v4"},
|
|
|
|
|
{sender: "Foks", content: "Here is one test event\nWith\n Multiple\nLines\n:)"},
|
|
|
|
|
{sender: "Different Foks", content: "Look at these nice colors"},
|
|
|
|
|
{sender: "Different Foks", content: "And the font"},
|
|
|
|
|
{sender: "Lain", content: "image"},
|
|
|
|
|
{sender: "Lain", content: "image"},
|
|
|
|
|
{sender: "Lain", content: "image"},
|
|
|
|
|
{sender: "Different Foks", content: "And the avatars"},
|
|
|
|
|
{sender: "Foks", content: "Every line has it's own message"},
|
|
|
|
|
{sender: "Foks", content: "But if the sender is the same, we don't repeat the name+image"},
|
|
|
|
|
{sender: "Foks", content: "Isn't message grouping great?"}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
newEvent: function() {
|
|
|
|
|
let events = this.state.events
|
|
|
|
|
events.push({sender: "Random person", content: "New message"})
|
|
|
|
|
this.setState({events: events})
|
|
|
|
|
setTimeout(this.newEvent, 5000)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
|
console.log("Render function")
|
|
|
|
|
let rooms = backend.getRooms()
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Sidebar/>
|
|
|
|
|
<Sidebar rooms={rooms}/>
|
|
|
|
|
<div className="main">
|
|
|
|
|
<Info />
|
|
|
|
|
<Chat events={this.state.events}/>
|
|
|
|
|
<Chat events={backend.getEvents()}/>
|
|
|
|
|
<Input />
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|