Add method to create avatar section
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
0a4f8aff79
commit
653fcbbb1f
1 changed files with 9 additions and 1 deletions
|
@ -7,7 +7,10 @@ export class RoomInfoView extends TemplateView {
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
const encryptionString = vm.isEncrypted ? "On" : "Off";
|
const encryptionString = vm.isEncrypted ? "On" : "Off";
|
||||||
return t.div({ className: "RoomInfo" }, [
|
return t.div({ className: "RoomInfo" }, [
|
||||||
t.div({ className: "RoomAvatar" }, [t.view(new AvatarView(vm, 128))]),
|
|
||||||
|
t.div({ className: "RoomAvatar" },
|
||||||
|
[t.view(new AvatarView(vm, 52)), this._createEncryptionIcon(vm.isEncrypted)]),
|
||||||
|
|
||||||
t.div({ className: "RoomName" }, [t.h2(vm.name)]),
|
t.div({ className: "RoomName" }, [t.h2(vm.name)]),
|
||||||
|
|
||||||
t.div({ className: "RoomId" }, [text(vm.roomId)]),
|
t.div({ className: "RoomId" }, [text(vm.roomId)]),
|
||||||
|
@ -26,4 +29,9 @@ export class RoomInfoView extends TemplateView {
|
||||||
tag.div({ className: valueClassString }, [text(value)])
|
tag.div({ className: valueClassString }, [text(value)])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_createEncryptionIcon(isEncrypted) {
|
||||||
|
return tag.div({ className: "RoomEncryption" },
|
||||||
|
[tag.div({ className: isEncrypted ? "encrypted" : "unencrypted" })])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue