mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Swap grid tile description based on focus
swap RoomPlaceholderView for generic StaticView
This commit is contained in:
parent
93e301e4fa
commit
35832e387a
@ -28,6 +28,11 @@ html {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.room-placeholder {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
.SessionView {
|
.SessionView {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -64,7 +69,7 @@ html {
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.RoomPlaceholderView, .RoomView, .RoomGridView {
|
.room-placeholder, .RoomView, .RoomGridView {
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,6 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.RoomPlaceholderView {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.RoomHeader {
|
.RoomHeader {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ a {
|
|||||||
background-color: #555;
|
background-color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.RoomPlaceholderView {
|
.room-placeholder {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ a {
|
|||||||
top: 72px;
|
top: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.RoomPlaceholderView {
|
.room-placeholder {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -346,6 +346,19 @@ a {
|
|||||||
border-bottom: 1px solid rgba(245, 245, 245, 0.90);
|
border-bottom: 1px solid rgba(245, 245, 245, 0.90);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.RoomGridView > .focused > .room-placeholder .unfocused {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.RoomGridView > :not(.focused) > .room-placeholder .focused {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.room-placeholder .unfocused {
|
||||||
|
color: #8D99A5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.RoomGridView > div.focus-ring {
|
.RoomGridView > div.focus-ring {
|
||||||
border: 2px solid rgba(134, 193, 165, 1);
|
border: 2px solid rgba(134, 193, 165, 1);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2020 Bruno Windels <bruno@windels.cloud>
|
Copyright 2020 Bruno Windels <bruno@windels.cloud>
|
||||||
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -16,13 +17,12 @@ limitations under the License.
|
|||||||
|
|
||||||
import {tag} from "../general/html.js";
|
import {tag} from "../general/html.js";
|
||||||
|
|
||||||
export class RoomPlaceholderView {
|
export class StaticView {
|
||||||
constructor() {
|
constructor(render) {
|
||||||
this._root = null;
|
this._root = render(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
mount() {
|
mount() {
|
||||||
this._root = tag.div({className: "RoomPlaceholderView"}, tag.h2("Choose a room on the left side."));
|
|
||||||
return this._root;
|
return this._root;
|
||||||
}
|
}
|
||||||
|
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {RoomView} from "./room/RoomView.js";
|
import {RoomView} from "./room/RoomView.js";
|
||||||
import {RoomPlaceholderView} from "./RoomPlaceholderView.js";
|
|
||||||
import {TemplateView} from "../general/TemplateView.js";
|
import {TemplateView} from "../general/TemplateView.js";
|
||||||
|
import {StaticView} from "../general/StaticView.js";
|
||||||
|
|
||||||
export class RoomGridView extends TemplateView {
|
export class RoomGridView extends TemplateView {
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
@ -34,7 +34,10 @@ export class RoomGridView extends TemplateView {
|
|||||||
if (roomVM) {
|
if (roomVM) {
|
||||||
return new RoomView(roomVM);
|
return new RoomView(roomVM);
|
||||||
} else {
|
} else {
|
||||||
return new RoomPlaceholderView();
|
return new StaticView(t => t.div({className: "room-placeholder"}, [
|
||||||
|
t.h2({className: "focused"}, vm.i18n`Select a room on the left`),
|
||||||
|
t.h2({className: "unfocused"}, vm.i18n`Click to select this tile`),
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
import {LeftPanelView} from "./leftpanel/LeftPanelView.js";
|
import {LeftPanelView} from "./leftpanel/LeftPanelView.js";
|
||||||
import {RoomView} from "./room/RoomView.js";
|
import {RoomView} from "./room/RoomView.js";
|
||||||
import {TemplateView} from "../general/TemplateView.js";
|
import {TemplateView} from "../general/TemplateView.js";
|
||||||
import {RoomPlaceholderView} from "./RoomPlaceholderView.js";
|
import {StaticView} from "../general/StaticView.js";
|
||||||
import {SessionStatusView} from "./SessionStatusView.js";
|
import {SessionStatusView} from "./SessionStatusView.js";
|
||||||
import {RoomGridView} from "./RoomGridView.js";
|
import {RoomGridView} from "./RoomGridView.js";
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ export class SessionView extends TemplateView {
|
|||||||
case "roomgrid":
|
case "roomgrid":
|
||||||
return new RoomGridView(vm.roomGridViewModel);
|
return new RoomGridView(vm.roomGridViewModel);
|
||||||
case "placeholder":
|
case "placeholder":
|
||||||
return new RoomPlaceholderView();
|
return new StaticView(t => t.div({className: "room-placeholder"}, t.h2(vm.i18n`Choose a room on the left side.`)));
|
||||||
default: //room id
|
default: //room id
|
||||||
return new RoomView(vm.currentRoom);
|
return new RoomView(vm.currentRoom);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user