diff --git a/res/css/views/rooms/_RoomSublist.scss b/res/css/views/rooms/_RoomSublist.scss index 82bba40167..27c7c7d0f7 100644 --- a/res/css/views/rooms/_RoomSublist.scss +++ b/res/css/views/rooms/_RoomSublist.scss @@ -383,3 +383,22 @@ limitations under the License. .mx_RoomSublist_addRoomTooltip { margin-top: -3px; } + +.mx_RoomSublist_skeletonUI { + position: relative; + margin-left: 4px; + height: 288px; + + &::before { + background: $roomsublist-skeleton-ui-bg; + + width: 100%; + height: 100%; + + content: ''; + position: absolute; + mask-repeat: repeat-y; + mask-size: auto 48px; + mask-image: url('$(res)/img/element-icons/roomlist/skeleton-ui.svg'); + } +} diff --git a/res/img/element-icons/roomlist/skeleton-ui.svg b/res/img/element-icons/roomlist/skeleton-ui.svg new file mode 100644 index 0000000000..e95692536c --- /dev/null +++ b/res/img/element-icons/roomlist/skeleton-ui.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/res/themes/dark/css/_dark.scss b/res/themes/dark/css/_dark.scss index bd709473ef..6350439a4f 100644 --- a/res/themes/dark/css/_dark.scss +++ b/res/themes/dark/css/_dark.scss @@ -117,6 +117,7 @@ $roomlist-filter-active-bg-color: $bg-color; $roomlist-bg-color: rgba(33, 38, 44, 0.90); $roomlist-header-color: $tertiary-fg-color; $roomsublist-divider-color: $primary-fg-color; +$roomsublist-skeleton-ui-bg: linear-gradient(180deg, #3e444c 0%, #3e444c00 100%); $groupFilterPanel-divider-color: $roomlist-header-color; diff --git a/res/themes/legacy-dark/css/_legacy-dark.scss b/res/themes/legacy-dark/css/_legacy-dark.scss index 60d44b1c31..716d8c7385 100644 --- a/res/themes/legacy-dark/css/_legacy-dark.scss +++ b/res/themes/legacy-dark/css/_legacy-dark.scss @@ -114,6 +114,7 @@ $roomlist-filter-active-bg-color: $roomlist-button-bg-color; $roomlist-bg-color: $header-panel-bg-color; $roomsublist-divider-color: $primary-fg-color; +$roomsublist-skeleton-ui-bg: linear-gradient(180deg, #3e444c 0%, #3e444c00 100%); $groupFilterPanel-divider-color: $roomlist-header-color; diff --git a/res/themes/legacy-light/css/_legacy-light.scss b/res/themes/legacy-light/css/_legacy-light.scss index 52fb1c8ef2..8c42c5c97f 100644 --- a/res/themes/legacy-light/css/_legacy-light.scss +++ b/res/themes/legacy-light/css/_legacy-light.scss @@ -181,6 +181,7 @@ $roomlist-filter-active-bg-color: $roomlist-button-bg-color; $roomlist-bg-color: $header-panel-bg-color; $roomlist-header-color: $primary-fg-color; $roomsublist-divider-color: $primary-fg-color; +$roomsublist-skeleton-ui-bg: linear-gradient(180deg, #ffffff 0%, #ffffff00 100%); $groupFilterPanel-divider-color: $roomlist-header-color; diff --git a/res/themes/light/css/_light.scss b/res/themes/light/css/_light.scss index 0c5e271860..5437a6de1c 100644 --- a/res/themes/light/css/_light.scss +++ b/res/themes/light/css/_light.scss @@ -175,6 +175,7 @@ $roomlist-filter-active-bg-color: #ffffff; $roomlist-bg-color: rgba(245, 245, 245, 0.90); $roomlist-header-color: $tertiary-fg-color; $roomsublist-divider-color: $primary-fg-color; +$roomsublist-skeleton-ui-bg: linear-gradient(180deg, #ffffff 0%, #ffffff00 100%); $groupFilterPanel-divider-color: $roomlist-header-color; diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index 3a4d27e666..cd1ad09ab4 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -332,6 +332,8 @@ export default class RoomList extends React.PureComponent { return p; }, [] as TagID[]); + const showSkeleton = tagOrder.every(tag => !this.state.sublists[tag]?.length); + for (const orderedTagId of tagOrder) { const orderedRooms = this.state.sublists[orderedTagId] || []; const extraTiles = orderedTagId === DefaultTagID.Invite ? this.renderCommunityInvites() : null; @@ -356,6 +358,7 @@ export default class RoomList extends React.PureComponent { addRoomContextMenu={aesthetics.addRoomContextMenu} isMinimized={this.props.isMinimized} onResize={this.props.onResize} + showSkeleton={showSkeleton} extraBadTilesThatShouldntExist={extraTiles} />); } diff --git a/src/components/views/rooms/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index d93de47d6b..b5ae3285b9 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -71,6 +71,7 @@ interface IProps { isMinimized: boolean; tagId: TagID; onResize: () => void; + showSkeleton?: boolean; // TODO: Don't use this. It's for community invites, and community invites shouldn't be here. // You should feel bad if you use this. @@ -877,6 +878,8 @@ export default class RoomSublist extends React.Component { ); + } else if (this.props.showSkeleton && this.state.isExpanded) { + content =
; } return (