Skip to content

Instantly share code, notes, and snippets.

@dai-shi
Created March 28, 2016 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dai-shi/205c1a190d35732fc830 to your computer and use it in GitHub Desktop.
Save dai-shi/205c1a190d35732fc830 to your computer and use it in GitHub Desktop.
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}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment