Home Reference Source

application/components/content/content-dom-media.js

import React, {Component} from 'react';
import FlatButton from 'material-ui/FlatButton';
import Dialog from 'material-ui/Dialog';

import RichEditorMediaSearch from './../common/rich-editor/media-search';

class DominantMediaModal extends Component {

    handleSelectUrl() {

    }

    handleSelectMedia(media) {
        if (this.props.onSelectMedia) {
            this.props.onSelectMedia(media);
        }
    }

    handleCancel() {
        if (this.props.onRequestClose) {
            this.props.onRequestClose();
        }
    }

    render() {
        const actions = [
            <FlatButton
                onClick={this.handleCancel.bind(this)}
                label='Close'
                />
        ];

        return (
            <Dialog
                actions={actions}
                modal={false}
                open={this.props.isOpen}
                autoScrollBodyContent={true}
                repositionOnUpdate={true}
                >

                <RichEditorMediaSearch onSelectUrl={this.handleSelectUrl.bind(this)} onSelectMedia={this.handleSelectMedia.bind(this)} />
            </Dialog>
        );
    }
}

export default DominantMediaModal;