Move join button to buffer header
This commit is contained in:
parent
b0a3cd23e4
commit
6c40561f61
3 changed files with 10 additions and 17 deletions
|
@ -24,6 +24,10 @@ export default function BufferHeader(props) {
|
|||
event.preventDefault();
|
||||
props.onClose();
|
||||
}
|
||||
function handleJoinClick(event) {
|
||||
event.preventDefault();
|
||||
props.onJoin();
|
||||
}
|
||||
|
||||
var description = null;
|
||||
if (props.buffer.serverInfo) {
|
||||
|
@ -63,9 +67,11 @@ export default function BufferHeader(props) {
|
|||
description = html`<${NickStatus} status=${UserStatus.OFFLINE}/> ${props.buffer.name}`;
|
||||
}
|
||||
|
||||
var actions = null;
|
||||
var closeText = "Close";
|
||||
switch (props.buffer.type) {
|
||||
case BufferType.SERVER:
|
||||
actions = html`<a href="#" onClick=${handleJoinClick}>Join</a>`;
|
||||
closeText = "Disconnect";
|
||||
break;
|
||||
case BufferType.CHANNEL:
|
||||
|
@ -76,6 +82,8 @@ export default function BufferHeader(props) {
|
|||
return html`
|
||||
<span class="description">${description}</span>
|
||||
<span class="actions">
|
||||
${actions}
|
||||
${" "}
|
||||
<a href="#" onClick=${handlePartClick}>${closeText}</a>
|
||||
</span>
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue