Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
@import "./views/rooms/_RoomKnocksBar.pcss";
@import "./views/rooms/_RoomPreviewBar.pcss";
@import "./views/rooms/_RoomPreviewCard.pcss";
@import "./views/rooms/_RoomPreviewContext.pcss";
@import "./views/rooms/_RoomSearchAuxPanel.pcss";
@import "./views/rooms/_RoomSublist.pcss";
@import "./views/rooms/_RoomTile.pcss";
Expand Down
47 changes: 47 additions & 0 deletions res/css/views/rooms/_RoomPreviewContext.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
Copyright 2025 New Vector Ltd.

SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/

.mx_RoomPreviewContext {
> li {
list-style: none;
margin-bottom: var(--cpd-space-2x);
}
text-align: left;
}

.mx_RoomPreviewContext_detailsItem {
display: flex;
gap: var(--cpd-space-1x);

svg {
width: 1.5em;
height: 1.5em;
}

&.safe {
color: var(--cpd-color-text-success-primary);
}

&.unknown {
color: var(--cpd-color-text-info-primary);
}

&.unsafe {
color: var(--cpd-color-text-critical-primary);
}

h1 {
font-size: var(--cpd-font-size-body-md);
margin: 0;
}

p {
color: var(--cpd-color-text-secondary);
margin-top: 2px;
margin-bottom: 0;
}
}
4 changes: 4 additions & 0 deletions src/components/views/rooms/RoomPreviewBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ModuleRunner } from "../../../modules/ModuleRunner";
import { Icon as AskToJoinIcon } from "../../../../res/img/element-icons/ask-to-join.svg";
import Field from "../elements/Field";
import ModuleApi from "../../../modules/Api.ts";
import { RoomPreviewContext } from "./RoomPreviewContext.tsx";

const MemberEventHtmlReasonField = "io.element.html_reason";

Expand Down Expand Up @@ -317,6 +318,7 @@ class RoomPreviewBar extends React.Component<IProps, IState> {
let title: string | undefined;
let subTitle: string | ReactNode[] | undefined;
let reasonElement: JSX.Element | undefined;
let inviteContext: JSX.Element | undefined;
let primaryActionHandler: (() => void) | undefined;
let primaryActionLabel: string | undefined;
let secondaryActionHandler: (() => void) | undefined;
Expand Down Expand Up @@ -557,6 +559,7 @@ class RoomPreviewBar extends React.Component<IProps, IState> {
/>
);
}
inviteContext = <RoomPreviewContext inviterMember={inviteMember} />;

primaryActionHandler = this.props.onJoinClick;
secondaryActionLabel = _t("action|decline");
Expand Down Expand Up @@ -736,6 +739,7 @@ class RoomPreviewBar extends React.Component<IProps, IState> {
{subTitleElements}
</div>
{reasonElement}
{inviteContext}
<div
className={classNames("mx_RoomPreviewBar_actions", {
mx_RoomPreviewBar_fullWidth: messageCase === MessageCase.PromptAskToJoin,
Expand Down
Loading
Loading