diff --git a/12-component-refactor.html b/12-component-refactor.html index be47318..f9d99b3 100644 --- a/12-component-refactor.html +++ b/12-component-refactor.html @@ -56,15 +56,17 @@ var barStyle = { display: "inline-block", background: "lightgrey", - width: room.people * 25 + width: room.people * 20 }; + var count = room.people; return (
- {room.people > 0 ? ( - {room.people} People - ) : ( - 0 People - )} + {count < 10 ? 0 : ""}{count} People + { + count > 0 + ?   + : + } in {room.name}
); @@ -147,4 +149,4 @@

Dynamic refactor

); ReactDOM.render(reactElement, document.getElementById("app")); - \ No newline at end of file +