Created
May 17, 2018 18:52
-
-
Save gshzn/4dcd0c73b4ce5623ba3d53cd9565221c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import PropTypes from "prop-types"; | |
import classnames from "classnames"; | |
import Blaze from "meteor/gadicc:blaze-react-component"; | |
import { Template } from "meteor/templating"; | |
import { registerComponent } from "@reactioncommerce/reaction-components"; | |
class CoreLayoutBeesknees extends Component { | |
static propTypes = { | |
actionViewIsOpen: PropTypes.bool, | |
data: PropTypes.object, | |
structure: PropTypes.object | |
} | |
render() { | |
const { layoutHeader, layoutFooter, template } = this.props.structure || {}; | |
const pageClassName = classnames({ | |
"page": true, | |
"show-settings": this.props.actionViewIsOpen | |
}); | |
return ( | |
<div className={pageClassName} id="reactionAppContainer"> | |
{ Template[layoutHeader] && | |
<Blaze template={layoutHeader} className="reaction-navigation-header" /> | |
} | |
<Blaze template="cartDrawer" className="reaction-cart-drawer" /> | |
{ Template[template] && | |
<main> | |
<div className="rui beesknees"> | |
<div className="bkdebug"><em>{"Bee's Knees layout"}</em></div> | |
<div className="bkdebug"><em>{"layoutHeader template:"}</em> {this.props.structure.layoutHeader}</div> | |
<div className="bkdebug"><em>{"layoutFooter template:"}</em> {this.props.structure.layoutFooter}</div> | |
<div className="bkdebug"><em>{"Main Template:"}</em> {this.props.structure.template}</div> | |
</div> | |
<Blaze template={template} /> | |
</main> | |
} | |
{ Template[layoutFooter] && | |
<Blaze template={layoutFooter} className="reaction-navigation-footer footer-default" /> | |
} | |
</div> | |
); | |
} | |
} | |
// Register component for it to be usable | |
registerComponent("coreLayoutBeesknees", CoreLayoutBeesknees); | |
export default CoreLayoutBeesknees; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment