Home Reference Source

application/components/common/content-search-modal.js

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

import ContentSearch from './content-search/search';

class ContentSearchModal extends Component {

    handleSelectUrl() {

    }

    handleSelectContent(content) {
        if (this.props.onSelectContent) {
            this.props.onSelectContent(content);
        }
    }

    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}
                >

                <ContentSearch contentType={this.props.contentType} onSelectContent={this.handleSelectContent.bind(this)} />
            </Dialog>
        );
    }
}

export default ContentSearchModal;