Skip to content

Commit a481f3b

Browse files
committed
Iterate the filtering prompt
1 parent d3fee54 commit a481f3b

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

res/css/views/rooms/_RoomList.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ limitations under the License.
3333

3434
div:first-child {
3535
font-weight: $font-semi-bold;
36-
margin-bottom: 8px;
3736
}
3837

3938
.mx_AccessibleButton {
4039
color: $secondary-fg-color;
4140
position: relative;
4241
padding: 0 0 0 24px;
4342
font-size: inherit;
43+
margin-top: 8px;
4444

4545
&::before {
4646
content: '';
@@ -53,6 +53,13 @@ limitations under the License.
5353
mask-position: center;
5454
mask-size: contain;
5555
mask-repeat: no-repeat;
56+
}
57+
58+
&.mx_RoomList_explorePrompt_startChat::before {
59+
mask-image: url('$(res)/img/element-icons/feedback.svg');
60+
}
61+
62+
&.mx_RoomList_explorePrompt_explore::before {
5663
mask-image: url('$(res)/img/element-icons/roomlist/explore.svg');
5764
}
5865
}

src/components/views/rooms/RoomList.tsx

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
284284
}
285285
};
286286

287+
private onStartChat = () => {
288+
dis.dispatch({action: "view_create_chat"});
289+
};
290+
287291
private onExplore = () => {
288292
dis.fire(Action.ViewRoomDirectory);
289293
};
@@ -335,8 +339,9 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
335339
return p;
336340
}, [] as TagID[]);
337341

338-
// show a skeleton UI if the user is in no rooms
339-
const showSkeleton = Object.values(RoomListStore.instance.unfilteredLists).every(list => !list?.length);
342+
// show a skeleton UI if the user is in no rooms and they are not filtering
343+
const showSkeleton = !this.state.isNameFiltering &&
344+
Object.values(RoomListStore.instance.unfilteredLists).every(list => !list?.length);
340345

341346
for (const orderedTagId of tagOrder) {
342347
const orderedRooms = this.state.sublists[orderedTagId] || [];
@@ -376,7 +381,18 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
376381
if (this.state.isNameFiltering) {
377382
explorePrompt = <div className="mx_RoomList_explorePrompt">
378383
<div>{_t("Can't see what you’re looking for?")}</div>
379-
<AccessibleButton kind="link" onClick={this.onExplore}>
384+
<AccessibleButton
385+
className="mx_RoomList_explorePrompt_startChat"
386+
kind="link"
387+
onClick={this.onStartChat}
388+
>
389+
{_t("Start a new chat")}
390+
</AccessibleButton>
391+
<AccessibleButton
392+
className="mx_RoomList_explorePrompt_explore"
393+
kind="link"
394+
onClick={this.onExplore}
395+
>
380396
{_t("Explore all public rooms")}
381397
</AccessibleButton>
382398
</div>;
@@ -388,7 +404,18 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
388404
if (unfilteredRooms.length < 1 && unfilteredHistorical < 1) {
389405
explorePrompt = <div className="mx_RoomList_explorePrompt">
390406
<div>{_t("Use the + to make a new room or explore existing ones below")}</div>
391-
<AccessibleButton kind="link" onClick={this.onExplore}>
407+
<AccessibleButton
408+
className="mx_RoomList_explorePrompt_startChat"
409+
kind="link"
410+
onClick={this.onStartChat}
411+
>
412+
{_t("Start a new chat")}
413+
</AccessibleButton>
414+
<AccessibleButton
415+
className="mx_RoomList_explorePrompt_explore"
416+
kind="link"
417+
onClick={this.onExplore}
418+
>
392419
{_t("Explore all public rooms")}
393420
</AccessibleButton>
394421
</div>;

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,7 @@
13911391
"Historical": "Historical",
13921392
"Custom Tag": "Custom Tag",
13931393
"Can't see what you’re looking for?": "Can't see what you’re looking for?",
1394+
"Start a new chat": "Start a new chat",
13941395
"Explore all public rooms": "Explore all public rooms",
13951396
"Use the + to make a new room or explore existing ones below": "Use the + to make a new room or explore existing ones below",
13961397
"%(count)s results|other": "%(count)s results",

0 commit comments

Comments
 (0)