Update dependency @vector-im/compound-web to v2 (#12133)
* Update dependency @vector-im/compound-web to v2 * Update Tooltip props Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Include TooltipProvider in MatrixChat Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix pillify & tooltipify Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests to use TooltipProvider where necessary Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix tooltips in Modals, ContextMenus, PersistedElements, Spoiler, HtmlExport Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix tooltips in HTMLExport Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Don't pass mountAsChild to DOM Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * prettier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Stabilise test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
54b71140b8
commit
56d8ef3640
51 changed files with 293 additions and 221 deletions
|
@ -46,7 +46,7 @@ const FacePile: FC<IProps> = ({
|
|||
tooltipLabel
|
||||
? (m) => <MemberAvatar key={m.userId} member={m} size={size} hideTitle />
|
||||
: (m) => (
|
||||
<Tooltip key={m.userId} label={m.name} shortcut={tooltipShortcut}>
|
||||
<Tooltip key={m.userId} label={m.name} caption={tooltipShortcut}>
|
||||
<MemberAvatar
|
||||
member={m}
|
||||
size={size}
|
||||
|
@ -72,7 +72,7 @@ const FacePile: FC<IProps> = ({
|
|||
);
|
||||
|
||||
return tooltipLabel ? (
|
||||
<Tooltip label={tooltipLabel} shortcut={tooltipShortcut}>
|
||||
<Tooltip label={tooltipLabel} caption={tooltipShortcut}>
|
||||
{content}
|
||||
</Tooltip>
|
||||
) : (
|
||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
import React, { MutableRefObject, ReactNode } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { isNullOrUndefined } from "matrix-js-sdk/src/utils";
|
||||
import { TooltipProvider } from "@vector-im/compound-web";
|
||||
|
||||
import dis from "../../../dispatcher/dispatcher";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
|
@ -176,9 +177,11 @@ export default class PersistedElement extends React.Component<IProps> {
|
|||
private renderApp(): void {
|
||||
const content = (
|
||||
<MatrixClientContext.Provider value={MatrixClientPeg.safeGet()}>
|
||||
<div ref={this.collectChild} style={this.props.style}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
<TooltipProvider>
|
||||
<div ref={this.collectChild} style={this.props.style}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
</MatrixClientContext.Provider>
|
||||
);
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import React, { createRef, SyntheticEvent, MouseEvent } from "react";
|
|||
import ReactDOM from "react-dom";
|
||||
import highlight from "highlight.js";
|
||||
import { MsgType } from "matrix-js-sdk/src/matrix";
|
||||
import { TooltipProvider } from "@vector-im/compound-web";
|
||||
|
||||
import * as HtmlUtils from "../../../HtmlUtils";
|
||||
import { formatDate } from "../../../DateUtils";
|
||||
|
@ -347,7 +348,11 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
|
|||
|
||||
const reason = node.getAttribute("data-mx-spoiler") ?? undefined;
|
||||
node.removeAttribute("data-mx-spoiler"); // we don't want to recurse
|
||||
const spoiler = <Spoiler reason={reason} contentHtml={node.outerHTML} />;
|
||||
const spoiler = (
|
||||
<TooltipProvider>
|
||||
<Spoiler reason={reason} contentHtml={node.outerHTML} />
|
||||
</TooltipProvider>
|
||||
);
|
||||
|
||||
ReactDOM.render(spoiler, spoilerContainer);
|
||||
node.parentNode?.replaceChild(spoilerContainer, node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue