Render mini user menu for when space panel is disabled (#7258)
This commit is contained in:
parent
d3c556bef7
commit
0a99be3d65
5 changed files with 23 additions and 5 deletions
|
@ -111,6 +111,11 @@ $roomListCollapsedWidth: 68px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
.mx_UserMenu {
|
||||||
|
// mini-mode for when Space Panel is disabled
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
& + .mx_RoomListHeader {
|
& + .mx_RoomListHeader {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,6 +349,12 @@ $activeBorderColor: $primary-content;
|
||||||
mask-image: linear-gradient(180deg, transparent, black 5%, black 95%, transparent);
|
mask-image: linear-gradient(180deg, transparent, black 5%, black 95%, transparent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_UserMenu {
|
||||||
|
padding: 0 2px 8px;
|
||||||
|
border-bottom: 1px solid $quinary-content;
|
||||||
|
margin: 12px 14px 4px 18px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_SpacePanel_contextMenu {
|
.mx_SpacePanel_contextMenu {
|
||||||
|
|
|
@ -15,9 +15,6 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.mx_UserMenu {
|
.mx_UserMenu {
|
||||||
padding: 0 2px 8px;
|
|
||||||
border-bottom: 1px solid $quinary-content;
|
|
||||||
margin: 12px 14px 4px 18px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -43,6 +43,7 @@ import { UPDATE_EVENT } from "../../stores/AsyncStore";
|
||||||
import IndicatorScrollbar from "./IndicatorScrollbar";
|
import IndicatorScrollbar from "./IndicatorScrollbar";
|
||||||
import RoomBreadcrumbs from "../views/rooms/RoomBreadcrumbs";
|
import RoomBreadcrumbs from "../views/rooms/RoomBreadcrumbs";
|
||||||
import SettingsStore from "../../settings/SettingsStore";
|
import SettingsStore from "../../settings/SettingsStore";
|
||||||
|
import UserMenu from "./UserMenu";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
isMinimized: boolean;
|
isMinimized: boolean;
|
||||||
|
@ -380,6 +381,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
||||||
onBlur={this.onBlur}
|
onBlur={this.onBlur}
|
||||||
onKeyDown={this.onKeyDown}
|
onKeyDown={this.onKeyDown}
|
||||||
>
|
>
|
||||||
|
{ !SpaceStore.spacesEnabled && <UserMenu isPanelCollapsed={true} /> }
|
||||||
<RoomSearch
|
<RoomSearch
|
||||||
isMinimized={this.props.isMinimized}
|
isMinimized={this.props.isMinimized}
|
||||||
ref={this.roomSearchRef}
|
ref={this.roomSearchRef}
|
||||||
|
@ -420,7 +422,12 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
||||||
<aside className="mx_LeftPanel_roomListContainer">
|
<aside className="mx_LeftPanel_roomListContainer">
|
||||||
{ this.renderSearchDialExplore() }
|
{ this.renderSearchDialExplore() }
|
||||||
{ this.renderBreadcrumbs() }
|
{ this.renderBreadcrumbs() }
|
||||||
{ !this.props.isMinimized && <RoomListHeader onVisibilityChange={this.refreshStickyHeaders} /> }
|
{ !this.props.isMinimized && (
|
||||||
|
<RoomListHeader
|
||||||
|
onVisibilityChange={this.refreshStickyHeaders}
|
||||||
|
spacePanelDisabled={!SpaceStore.spacesEnabled}
|
||||||
|
/>
|
||||||
|
) }
|
||||||
<div className="mx_LeftPanel_roomListWrapper">
|
<div className="mx_LeftPanel_roomListWrapper">
|
||||||
<div
|
<div
|
||||||
className={roomListClasses}
|
className={roomListClasses}
|
||||||
|
|
|
@ -148,10 +148,11 @@ const useJoiningRooms = (): Set<string> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
spacePanelDisabled: boolean;
|
||||||
onVisibilityChange?(): void;
|
onVisibilityChange?(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RoomListHeader = ({ onVisibilityChange }: IProps) => {
|
const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
||||||
const cli = useContext(MatrixClientContext);
|
const cli = useContext(MatrixClientContext);
|
||||||
const [mainMenuDisplayed, mainMenuHandle, openMainMenu, closeMainMenu] = useContextMenu<HTMLDivElement>();
|
const [mainMenuDisplayed, mainMenuHandle, openMainMenu, closeMainMenu] = useContextMenu<HTMLDivElement>();
|
||||||
const [plusMenuDisplayed, plusMenuHandle, openPlusMenu, closePlusMenu] = useContextMenu<HTMLDivElement>();
|
const [plusMenuDisplayed, plusMenuHandle, openPlusMenu, closePlusMenu] = useContextMenu<HTMLDivElement>();
|
||||||
|
@ -183,6 +184,8 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
|
||||||
return <div className="mx_LeftPanel_roomListFilterCount">
|
return <div className="mx_LeftPanel_roomListFilterCount">
|
||||||
{ _t("%(count)s results", { count }) }
|
{ _t("%(count)s results", { count }) }
|
||||||
</div>;
|
</div>;
|
||||||
|
} else if (spacePanelDisabled) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const communityId = CommunityPrototypeStore.instance.getSelectedCommunityId();
|
const communityId = CommunityPrototypeStore.instance.getSelectedCommunityId();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue