/** * @author oldj * @blog http://oldj.net */ 'use strict' import React from 'react' import Agent from '../Agent' import { Modal, Button } from 'antd' import './MyFrame.less' export default class MyFrame extends React.Component { constructor (props) { super(props) } componentDidMount () { Agent.on('esc', () => { this.onCancel() }) } onOK () { this.props.onOK() } onCancel () { this.props.onCancel() } renderFootButtons () { let html = [] let {lang} = this.props html.push(
{this.props.cancel_title || lang.cancel}
) html.push(
{this.props.ok_title || lang.ok}
) return html } render () { if (!this.props.show) { return null } let {show, title, body, lang, width, okText} = this.props return ( {title})} onOk={this.onOK.bind(this)} onCancel={this.onCancel.bind(this)} wrapClassName="frame" width={width} footer={[ , ]} >
{body}
{/*
*/} {/*
{this.props.head}
*/} {/*
{this.props.body}
*/} {/*
{this.renderFootButtons()}
*/} {/*
*/}
) } }