You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Add voice broadcast pre-recoding PiP (#9548)
This commit is contained in:
@ -19,6 +19,7 @@ import { MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg';
|
||||
import MatrixClientContext from "../../src/contexts/MatrixClientContext";
|
||||
import { SDKContext, SdkContextClass } from "../../src/contexts/SDKContext";
|
||||
|
||||
type WrapperProps<T> = { wrappedRef?: RefCallback<ComponentType<T>> } & T;
|
||||
|
||||
@ -39,3 +40,16 @@ export function wrapInMatrixClientContext<T>(WrappedComponent: ComponentType<T>)
|
||||
}
|
||||
return Wrapper;
|
||||
}
|
||||
|
||||
export function wrapInSdkContext<T>(
|
||||
WrappedComponent: ComponentType<T>,
|
||||
sdkContext: SdkContextClass,
|
||||
): ComponentType<WrapperProps<T>> {
|
||||
return class extends React.Component<WrapperProps<T>> {
|
||||
render() {
|
||||
return <SDKContext.Provider value={sdkContext}>
|
||||
<WrappedComponent {...this.props} />
|
||||
</SDKContext.Provider>;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user