Ensure iframe gets maximize/minimize events
This commit is contained in:
parent
6ccce7142c
commit
987ee702d3
2 changed files with 18 additions and 8 deletions
|
@ -64,10 +64,14 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
|||
this.onAccountDetailsRequest();
|
||||
break;
|
||||
case PostmessageAction.Maximize:
|
||||
this.maximizeDialog();
|
||||
this.setState({
|
||||
minimized: false,
|
||||
});
|
||||
break;
|
||||
case PostmessageAction.Minimize:
|
||||
this.minimizeDialog();
|
||||
this.setState({
|
||||
minimized: true,
|
||||
});
|
||||
break;
|
||||
case PostmessageAction.SetupComplete:
|
||||
// Set as completed but let the user close the modal themselves
|
||||
|
@ -82,17 +86,23 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
|||
}
|
||||
|
||||
private maximizeDialog = () => {
|
||||
if (this.state.minimized) {
|
||||
this.setState({
|
||||
minimized: false,
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
minimized: false,
|
||||
});
|
||||
// Send this action to the iframe so it can act accordingly
|
||||
this.sendMessage({
|
||||
action: PostmessageAction.Maximize,
|
||||
});
|
||||
}
|
||||
|
||||
private minimizeDialog = () => {
|
||||
this.setState({
|
||||
minimized: true,
|
||||
});
|
||||
// Send this action to the iframe so it can act accordingly
|
||||
this.sendMessage({
|
||||
action: PostmessageAction.Minimize,
|
||||
});
|
||||
}
|
||||
|
||||
private closeDialog = async () => {
|
||||
|
|
|
@ -38,7 +38,7 @@ export interface IPostmessageRequestData {
|
|||
|
||||
export interface IPostmessageResponseData {
|
||||
action: PostmessageAction;
|
||||
account: IAccountData;
|
||||
account?: IAccountData;
|
||||
}
|
||||
|
||||
export interface IPostmessage {
|
||||
|
|
Loading…
Reference in a new issue