Commit 7e74c4a1 authored by Ray Schamp's avatar Ray Schamp

Use classNames everywhere with dynamic classNames

Fixes GH-141, and keeps it from being introduced on Banner
parent ccd04889
var classNames = require('classnames');
var React = require('react');
require('./banner.scss');
......@@ -8,8 +9,12 @@ var Banner = React.createClass({
onRequestDismiss: React.PropTypes.func
},
render: function () {
var classes = classNames(
'banner',
this.props.className
);
return (
<div className={'banner ' + this.props.className}>
<div className={classes}>
<div className="inner">
{this.props.children}
{this.props.onRequestDismiss ? [
......
var classNames = require('classnames');
var React = require('react');
require('./box.scss');
......@@ -11,8 +12,12 @@ var Box = React.createClass({
moreProps: React.PropTypes.object
},
render: function () {
var classes = classNames(
'box',
this.props.className
);
return (
<div className={'box ' + this.props.className}>
<div className={classes}>
<div className="box-header">
<h4>{this.props.title}</h4>
<p>
......
var classNames = require('classnames');
var defaults = require('lodash.defaults');
var React = require('react');
var Slider = require('react-slick');
......@@ -31,9 +32,12 @@ var Carousel = React.createClass({
variableWidth: true
});
var arrows = this.props.items.length > settings.slidesToShow;
var classes = classNames(
'carousel',
this.props.className
);
return (
<Slider className={'carousel ' + this.props.className} arrows={arrows} {... settings}>
<Slider className={classes} arrows={arrows} {... settings}>
{this.props.items.map(function (item) {
var href = '';
switch (item.type) {
......
var classNames = require('classnames');
var React = require('react');
var render = require('../../lib/render.jsx');
......@@ -20,9 +21,13 @@ var Hoc = React.createClass({
});
},
render: function () {
var classes = classNames(
'top-banner',
this.state.bgClass
);
return (
<div>
<div className={'top-banner ' + this.state.bgClass}>
<div className={classes}>
<h1>Get Creative with Coding</h1>
<p>
With Scratch, you can program your own stories, games, and animations —
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment