Wire up dragging

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-05-02 16:26:54 +02:00
parent f64a950195
commit 11222e7a46
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -209,8 +209,26 @@ export default class CallPreview extends React.Component<IProps, IState> {
public render() {
if (this.state.primaryCall) {
const translatePixelsX = this.state.translationX + "px";
const translatePixelsY = this.state.translationY + "px";
const style = {
transform: `translateX(${translatePixelsX})
translateY(${translatePixelsY})`,
};
return (
<CallView call={this.state.primaryCall} secondaryCall={this.state.secondaryCall} pipMode={true} />
<div className="mx_CallPreview" style={style}>
<CallView
call={this.state.primaryCall}
secondaryCall={this.state.secondaryCall}
pipMode={true}
dragCallbacks={{
onStartMoving: this.onStartMoving,
onMoving: this.onMoving,
onEndMoving: this.onEndMoving,
}}
/>
</div>
);
}