Skip to content

Instantly share code, notes, and snippets.

@dai-shi
Created March 28, 2016 08:54
Show Gist options
  • Select an option

  • Save dai-shi/205c1a190d35732fc830 to your computer and use it in GitHub Desktop.

Select an option

Save dai-shi/205c1a190d35732fc830 to your computer and use it in GitHub Desktop.

Revisions

  1. dai-shi created this gist Mar 28, 2016.
    23 changes: 23 additions & 0 deletions simple-todos-react-10.10.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    diff --git a/imports/ui/Task.jsx b/imports/ui/Task.jsx
    index db0999e..52450c3 100644
    --- a/imports/ui/Task.jsx
    +++ b/imports/ui/Task.jsx
    @@ -1,5 +1,6 @@
    import React, { Component, PropTypes } from 'react';
    import { Meteor } from 'meteor/meteor';
    +import classnames from 'classnames';

    // Task component - represents a single todo item
    export default class Task extends Component {
    @@ -19,7 +20,10 @@ export default class Task extends Component {
    render() {
    // Give tasks a different className when they are checked off,
    // so that we can style them nicely in CSS
    - const taskClassName = this.props.task.checked ? 'checked' : '';
    + const taskClassName = classnames({
    + checked: this.props.task.checked,
    + private: this.props.task.private,
    + });

    return (
    <li className={taskClassName}>