You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
899 B
React
41 lines
899 B
React
5 years ago
|
"use strict";
|
||
|
|
||
|
const React = require("react");
|
||
|
|
||
|
const Layout = require("./layout");
|
||
|
|
||
|
function Room({ room }) {
|
||
|
return (
|
||
|
<div className="room">
|
||
|
<div className="name">{room.name}</div>
|
||
|
<div className="userCount">{room.num_joined_members} users</div>
|
||
|
<div className="alias">{room.canonical_alias}</div>
|
||
|
<div className="topic">{room.topic}</div>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
module.exports = function Rooms({ rooms, nextBatchUrl, previousBatchUrl }) {
|
||
|
return (
|
||
|
<Layout>
|
||
|
<div className="navigation">
|
||
|
{(previousBatchUrl != null)
|
||
|
? <a href={previousBatchUrl}><< Previous</a>
|
||
|
: null
|
||
|
}
|
||
|
{(previousBatchUrl != null && nextBatchUrl != null)
|
||
|
? " | "
|
||
|
: null
|
||
|
}
|
||
|
{(nextBatchUrl != null)
|
||
|
? <a href={nextBatchUrl}>Next >></a>
|
||
|
: null
|
||
|
}
|
||
|
</div>
|
||
|
{rooms.map((room) => {
|
||
|
return <Room key={room.id} room={room} />;
|
||
|
})}
|
||
|
</Layout>
|
||
|
);
|
||
|
};
|