render()

in packages/roosterjs-react-ribbon/lib/components/ConfirmDialog.tsx [35:78]


    render() {
        let onOk = () => this.onClick(this.props.onOkCallback);
        let onCancel = () => this.onClick(null);
        let strings = this.props.strings;
        return (
            <Dialog className={this.props.className}
                isOpen={this.state.isShown}
                onDismissed={this.onDismissed}
                title={this.props.title}>
                <form
                    onSubmit={evt => {
                        evt.preventDefault();
                        onOk();
                    }}>
                    <div className={Styles.dialogContent}>
                        <label className={Styles.dialogLabel}>
                            {this.props.subText}
                            <input
                                role="textbox"
                                type="text"
                                ref={ref => (this.input = ref)}
                                onChange={() =>
                                    this.setState({
                                        isShown: this.state.isShown,
                                        value: this.input.value,
                                    })
                                }
                                value={this.state.value}
                                className={Styles.dialogInput}
                            />
                        </label>
                    </div>
                </form>
                <DialogFooter>
                    <Button buttonType={ButtonType.primary} onClick={onOk}>
                        {getString('dlgOk', strings)}
                    </Button>
                    <Button buttonType={ButtonType.normal} onClick={onCancel}>
                        {getString('dlgCancel', strings)}
                    </Button>
                </DialogFooter>
            </Dialog>
        );
    }