-
-
Notifications
You must be signed in to change notification settings - Fork 829
Invite dialog: display MXID on its own line #11756
Invite dialog: display MXID on its own line #11756
Conversation
primaryActionLabel = _t("action|accept"); | ||
} | ||
subTitle = [avatar, inviterElement]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these don't have keys so shouldn't be an array, use a React Fragment instead please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subTitle
currently has a type of string | ReactNode[] | undefined
; is a React Fragment a ReactNode[]
or should the type of subTitle
be expanded to include it?
And is something like the below what you're after? It's a pattern used elsewhere in this function.
subTitle = [
<>
{avatar}
{inviterElement}
</>,
];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fragment would qualify as ReactNode, but if using an array must be given a key
otherwise https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key
Your snippet would work but would trigger the warning due to missing a key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh looks like the code further down inserts a key based on position, that's not ideal but good enough
subTitleElements = subTitle.map((t, i) => <p key={
subTitle${i}}>{t}</p>);
Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
https://build.opensuse.org/request/show/1196036 by user dheidler + anag+factory - Version 1.11.75 # Security - Fixes for GHSA-vhr5-g3pm-49fm (CVE-2024-42369). - Version 1.11.74 ## ✨ Features * Update unsupported browser react component to new designs (element-hq/element-web#27857). Contributed by @t3chguy. * Invite dialog: display MXID on its own line (matrix-org/matrix-react-sdk#11756). Contributed by @AndrewFerr. * Align RoomSummaryCard styles with Figma (matrix-org/matrix-react-sdk#12793). Contributed by @t3chguy. * Extract Extensions into their own right panel tab (matrix-org/matrix-react-sdk#12844). Contributed by @t3chguy. * Remove topic from new room header and expand right panel topic (http
https://build.opensuse.org/request/show/1196035 by user dheidler + anag+factory - Version 1.11.75 * Fixes for CVE-2024-42369 / GHSA-vhr5-g3pm-49fm. - Version 1.11.74 ## ✨ Features * Update unsupported browser react component to new designs (element-hq/element-web#27857). Contributed by @t3chguy. * Invite dialog: display MXID on its own line (matrix-org/matrix-react-sdk#11756). Contributed by @AndrewFerr. * Align RoomSummaryCard styles with Figma (matrix-org/matrix-react-sdk#12793). Contributed by @t3chguy. * Extract Extensions into their own right panel tab (matrix-org/matrix-react-sdk#12844). Contributed by @t3chguy. * Remove topic from new room header and expand right panel topic (matrix-org/matrix-react-sdk#12842). Contributed by @t3c
The reason for doing this is to make the invite dialog more readable when the inviter's MXID is very long, which tends to be the case when the inviter is a bridged user with a machine-generated MXID.
Screenshots
DM invite
Before
After
Room invite
Before
After
Checklist
Here's what your changelog entry will look like:
✨ Features