/**
 * Basic style for ApTheme.
 * @constructor ApHandyThemeStyle
 */

"use strict";

import React, {PropTypes as types} from 'react';
import handy from 'apeman-react-handy';
import {ApStyle} from 'apeman-react-style';
import styleContent from './style_content';

/** @lends ApHandyThemeStyle */
let ApHandyThemeStyle = React.createClass({
    propTypes: {
        scoped: types.bool,
        style: types.object,
        dominant: types.string.isRequired,
        subordinate: types.string.isRequired,
        accent: types.string.isRequired
    },
    getDefaultProps() {
        return {
            scoped: false,
            style: {}
        }
    },
    render() {
        let s = this,
            props = s.props;

        let {dominant, subordinate, accent} = props;

        let data = {
                '.ap-theme': {}
            },
            smallMediaData = {},
            mediumMediaData = {},
            largeMediaData = {};


        let themedStyle = [
            styleContent(<handy.ApSignStyle/>),
            styleContent(<handy.ApRecoverStyle/>),
            styleContent(<handy.ApProfileStyle/>)
        ].join('');


        return (
            <ApStyle scoped={props.scoped}
                     data={Object.assign(data, props.style)}
                     smallMediaData={smallMediaData}
                     mediumMediaData={mediumMediaData}
                     largeMediaData={largeMediaData}
            >
                {themedStyle}
                {props.children}
            </ApStyle>
        );

    }
});

module.exports = ApHandyThemeStyle;
