From 4f7b9e4747c7a24e178d1d2cf1ea4e53a8c49694 Mon Sep 17 00:00:00 2001 From: Micah Godbolt Date: Fri, 22 Feb 2019 12:21:40 -0800 Subject: [PATCH] js updates --- docs/step1-02/index.html | 2 +- docs/step1-02/style.css | 4 +- docs/step1-03/index.html | 2 +- docs/step1-03/style.css | 6 +- docs/step1-05/src/components/TodoHeader.tsx | 2 +- docs/step1-05/src/style.css | 6 +- docs/step1-06/src/components/TodoHeader.tsx | 6 +- docs/step1-06/src/style.css | 6 +- docs/step1-07/src/components/TodoHeader.tsx | 6 +- docs/step1-07/src/style.css | 6 +- step1-02/README.md | 94 +++++++++++++++++-- step1-02/demo/index.html | 1 - step1-02/demo/style.css | 4 + step1-02/exercise/index.html | 9 +- step1-02/exercise/style.css | 2 +- step1-02/final/index.html | 2 +- step1-02/final/style.css | 2 +- step1-03/README.md | 26 +++-- step1-03/demo/index.html | 16 ++-- step1-03/demo/style.css | 2 +- step1-03/exercise/index.html | 16 ++-- step1-03/exercise/style.css | 2 +- step1-03/final/index.html | 16 ++-- step1-03/final/style.css | 2 +- step1-04/README.md | 2 +- step1-04/demo/index.html | 6 -- step1-04/demo/src/App.tsx | 14 --- step1-04/demo/src/components/Counter.tsx | 24 +---- step1-04/demo/src/index.tsx | 4 - step1-05/demo/src/style.css | 2 +- .../exercise/src/components/TodoHeader.tsx | 2 +- step1-05/exercise/src/style.css | 2 +- step1-05/final/src/components/TodoHeader.tsx | 2 +- step1-05/final/src/style.css | 2 +- step1-06/demo/src/components/TodoHeader.tsx | 2 +- step1-06/demo/src/style.css | 2 +- .../exercise/src/components/TodoHeader.tsx | 6 +- step1-06/exercise/src/style.css | 2 +- step1-06/final/src/components/TodoHeader.tsx | 6 +- step1-06/final/src/style.css | 2 +- step1-07/demo/src/components/TodoHeader.tsx | 6 +- step1-07/demo/src/style.css | 2 +- .../exercise/src/components/TodoHeader.tsx | 6 +- step1-07/exercise/src/style.css | 2 +- step1-07/final/src/components/TodoHeader.tsx | 6 +- step1-07/final/src/style.css | 2 +- 46 files changed, 200 insertions(+), 144 deletions(-) diff --git a/docs/step1-02/index.html b/docs/step1-02/index.html index 7c9d40d..a48e0f8 100644 --- a/docs/step1-02/index.html +++ b/docs/step1-02/index.html @@ -5,7 +5,7 @@

todos

- +
diff --git a/docs/step1-02/style.css b/docs/step1-02/style.css index 15642d5..6274d33 100644 --- a/docs/step1-02/style.css +++ b/docs/step1-02/style.css @@ -1,5 +1,5 @@ body { - font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; width: 400px; margin: 20px auto; } @@ -28,7 +28,7 @@ h1 { background: transparent; border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/docs/step1-03/index.html b/docs/step1-03/index.html index c9278ac..bffbf7f 100644 --- a/docs/step1-03/index.html +++ b/docs/step1-03/index.html @@ -8,7 +8,7 @@ Add
- +
diff --git a/docs/step1-03/style.css b/docs/step1-03/style.css index c897b4c..347bb57 100644 --- a/docs/step1-03/style.css +++ b/docs/step1-03/style.css @@ -1,5 +1,5 @@ body { - font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; width: 400px; margin: 20px auto; } @@ -28,7 +28,7 @@ h1 { background: transparent; border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } @@ -47,4 +47,4 @@ footer span { .hidden { display: none; -} \ No newline at end of file +} diff --git a/docs/step1-05/src/components/TodoHeader.tsx b/docs/step1-05/src/components/TodoHeader.tsx index aa1ec8b..b6a566b 100644 --- a/docs/step1-05/src/components/TodoHeader.tsx +++ b/docs/step1-05/src/components/TodoHeader.tsx @@ -8,7 +8,7 @@ export class TodoHeader extends React.Component {
- +
diff --git a/docs/step1-05/src/style.css b/docs/step1-05/src/style.css index c897b4c..347bb57 100644 --- a/docs/step1-05/src/style.css +++ b/docs/step1-05/src/style.css @@ -1,5 +1,5 @@ body { - font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; width: 400px; margin: 20px auto; } @@ -28,7 +28,7 @@ h1 { background: transparent; border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } @@ -47,4 +47,4 @@ footer span { .hidden { display: none; -} \ No newline at end of file +} diff --git a/docs/step1-06/src/components/TodoHeader.tsx b/docs/step1-06/src/components/TodoHeader.tsx index c26e54b..c35fa7a 100644 --- a/docs/step1-06/src/components/TodoHeader.tsx +++ b/docs/step1-06/src/components/TodoHeader.tsx @@ -9,9 +9,9 @@ export class TodoHeader extends React.Component {
- - - + + +
); diff --git a/docs/step1-06/src/style.css b/docs/step1-06/src/style.css index c897b4c..347bb57 100644 --- a/docs/step1-06/src/style.css +++ b/docs/step1-06/src/style.css @@ -1,5 +1,5 @@ body { - font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; width: 400px; margin: 20px auto; } @@ -28,7 +28,7 @@ h1 { background: transparent; border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } @@ -47,4 +47,4 @@ footer span { .hidden { display: none; -} \ No newline at end of file +} diff --git a/docs/step1-07/src/components/TodoHeader.tsx b/docs/step1-07/src/components/TodoHeader.tsx index 99bda01..1c8cb08 100644 --- a/docs/step1-07/src/components/TodoHeader.tsx +++ b/docs/step1-07/src/components/TodoHeader.tsx @@ -23,13 +23,13 @@ export class TodoHeader extends React.Component { Add
- - -
diff --git a/docs/step1-07/src/style.css b/docs/step1-07/src/style.css index c897b4c..347bb57 100644 --- a/docs/step1-07/src/style.css +++ b/docs/step1-07/src/style.css @@ -1,5 +1,5 @@ body { - font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; width: 400px; margin: 20px auto; } @@ -28,7 +28,7 @@ h1 { background: transparent; border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } @@ -47,4 +47,4 @@ footer span { .hidden { display: none; -} \ No newline at end of file +} diff --git a/step1-02/README.md b/step1-02/README.md index 151ab5a..2b29ba0 100644 --- a/step1-02/README.md +++ b/step1-02/README.md @@ -1,13 +1,95 @@ ## HTML and CSS +Every website, application, form or component starts with markup. The HTML will change over time as you develop, but a first pass helps you understand the UI you are trying to build. + ## Demo -Write html tag down to ul > li, footer -add CSS link -Add active styles, describe specificity +In this exercise we will scaffold out some HTML for out Todo app, and add some basic styling to it. + +### Page scaffold + +```html + + + + + +``` + +1. The DOCTYPE tells the browser that this file is written in modern HTML. +2. The HTML tag wraps the entire page, and is the page root. Nothing is placed outside of those tags. Attributes can be set on HTML +3. Head will contain all of the page's meta data, in this case a link to our css file +4. Body is where all of the visible content should be placed. + +### Content Sectioning + +As we saw in the previous demo, HTML elements can be used to describe different content sections of the applications. Let's add `header`, `main` and `footer`, as well as populate the header with an `h1`, addTodo div, and `nav` for our filters. + +```html + +
+

+
+ +
+
+
+ +``` + +> Note that a `form` element would have been more semantic than a `div`, but we aren't using this form to POST to a server, so for this example a div is easier to use. + +### Updating the header + +The header of our page is where most of the action is going to happen. First, lets give our page a title, adding 'TODO' to our `h1`. Then we can add an input and button to our `addTodo` div. + +```html + +``` + +#### Navigation + +The navigation for this application is quite simple. We want users to be able to switch between three filtered states. Since we need to track which state is currently selected, we'll add that as a class on the first item. + +```html + +``` + +### Adding styles + +Now that we've got the top of our application scaffolded, we can add some our styles in the head. + +```html + + + +``` + +### Updating styles + +It looks like the selected button isn't getting any special styles. Let's dig in and see why that is. + +Open up the browser inspector and target our 'all' button. You'll notice that the blue style is present on the list, but it is being overriden by the `border: none` above it. This is a situation where specificity is winning out over the cascade. + +> **Cascade** states that if two selectors are equal, the lowest one on the page wins + +> **Specificity** states that regardless of cascade, the selector with the highest specificity wins + +To fix this problem we need to either reduce the specificity of our button styles, or increase the specificity of the selected style. In this situation we will add `.filter` in front of the `.selected` selector, because the selected style only applies to the filter anyway. ## Exercise -Update list item to match (already styled) -duplicate 3 more times -Add and style footer content +1. Add an unordered list with class `todos` to the main section +2. Add 4 list items with class `todo` inside of that list with the following content + `` +3. Add a span and a button to your footer +4. Span content should be `4 items left` and button should say `Clear Completed` and have a class of `submit` +5. Go into the CSS file and add `display: flex` to the footer. Also add `flex-grow:1` to the span inside of the footer + +> Hint: Look back at the CSS demo to see the various ways you can use selectors to target existing HTML + +> There are many strategies for creating and organizing class names in a large application. This lesson is focused on using CSS selectors, not the optimized way to scale your CSS. diff --git a/step1-02/demo/index.html b/step1-02/demo/index.html index 0e76edd..e69de29 100644 --- a/step1-02/demo/index.html +++ b/step1-02/demo/index.html @@ -1 +0,0 @@ - diff --git a/step1-02/demo/style.css b/step1-02/demo/style.css index 4df1196..9ed149d 100644 --- a/step1-02/demo/style.css +++ b/step1-02/demo/style.css @@ -31,6 +31,10 @@ h1 { border: none; } +.selected { + border-bottom: 2px solid blue; +} + .todos { list-style: none; padding: 0; diff --git a/step1-02/exercise/index.html b/step1-02/exercise/index.html index 52cf71f..ee6a337 100644 --- a/step1-02/exercise/index.html +++ b/step1-02/exercise/index.html @@ -11,15 +11,12 @@
-
-
    -
  • Todo 1
  • -
-
+
+
diff --git a/step1-02/exercise/style.css b/step1-02/exercise/style.css index 986a4e1..b7b7c59 100644 --- a/step1-02/exercise/style.css +++ b/step1-02/exercise/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-02/final/index.html b/step1-02/final/index.html index 0ea87e3..d382af1 100644 --- a/step1-02/final/index.html +++ b/step1-02/final/index.html @@ -11,7 +11,7 @@ diff --git a/step1-02/final/style.css b/step1-02/final/style.css index 4163a3a..12b482b 100644 --- a/step1-02/final/style.css +++ b/step1-02/final/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-03/README.md b/step1-03/README.md index 3be1ffa..da92f8b 100644 --- a/step1-03/README.md +++ b/step1-03/README.md @@ -1,11 +1,25 @@ -Demo +## Javascript Demo -already done +Now that we a UI that looks like a todo app, we need to add functionality to make it **function** like a todo app. In this example we are going to use raw Javascript explicitly modify our application as we interact with it. This will be in stark contrast to the implicit approach we will take when we do this with React in the next exercise. -- addTodo -- filter -- filter() -- getTodoText +> Keep an eye on how often user actions directly modify the HTML on the page. You'll see this number drop to zero when we start using React. + +### Demo + +This demo starts off with a few elements already in place. Let's walk through what's already here. + +- **getTodoText()** - This is a quick helper function that returns the value inside of our textfield. Notice how some functions return values and how you can set that return to a variable. Other functions return nothing, but rather have side effects. +- **addTodo()** - This is the primary logic of our todo app. Here's how the lines break down. + 1. `todo` is set to equal the first todo item + 2. `newTodo` is a clone of todo. Passing true means it is a deep clone, so we get the todo's children as well. Cloning does not duplicate the DOM node. We'll need to insert it in step 4 + 3. We set the innerText of the `` to the value returned from getTodoText + > Note that if we left off the `()` we'd actully be assiging innerText to the 'function' instead of the function return + 4. Insert our new todo into the todo's parent (the `ul`), before our reference todo. [insertBefore](https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore) +- **filter()** - This function takes in a `filterName` string, and a `button` which is a reference to the clicked button. + 1. Remove any `selected` class names + 2. Add `selected` to the clicked button + 3. Get all of the todos with [querySelectAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll), and then loop through them. + 4. Set the `hidden` property of each todo based on the filter/state combination Walk through 'addTodo' attach addTodo to button diff --git a/step1-03/demo/index.html b/step1-03/demo/index.html index d03de04..3cd790b 100644 --- a/step1-03/demo/index.html +++ b/step1-03/demo/index.html @@ -8,10 +8,10 @@

todos

- +
@@ -52,16 +52,16 @@ // updateRemaining(); } - function filter(scope, button) { - document.querySelector('.active').classList.remove('active'); - button.classList.add('active'); + function filter(filterName, button) { + document.querySelector('.selected').classList.remove('selected'); + button.classList.add('selected'); for (let todo of document.querySelectorAll('.todo')) { const checked = todo.querySelector('input').checked == true; - if (scope == 'all') { + if (filterName == 'all') { todo.hidden = false; - } else if (scope == 'active') { + } else if (filterName == 'active') { todo.hidden = checked; - } else if (scope == 'completed') { + } else if (filterName == 'completed') { todo.hidden = !checked; } } diff --git a/step1-03/demo/style.css b/step1-03/demo/style.css index 4163a3a..12b482b 100644 --- a/step1-03/demo/style.css +++ b/step1-03/demo/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-03/exercise/index.html b/step1-03/exercise/index.html index 5894b7c..0c84bbe 100644 --- a/step1-03/exercise/index.html +++ b/step1-03/exercise/index.html @@ -8,10 +8,10 @@

todos

- +
@@ -64,16 +64,16 @@ // clearCompleted - function filter(scope, button) { - document.querySelector('.active').classList.remove('active'); - button.classList.add('active'); + function filter(filterName, button) { + document.querySelector('.selected').classList.remove('selected'); + button.classList.add('selected'); for (let todo of document.querySelectorAll('.todo')) { const checked = todo.querySelector('input').checked == true; - if (scope == 'all') { + if (filterName == 'all') { todo.hidden = false; - } else if (scope == 'active') { + } else if (filterName == 'active') { todo.hidden = checked; - } else if (scope == 'completed') { + } else if (filterName == 'completed') { todo.hidden = !checked; } } diff --git a/step1-03/exercise/style.css b/step1-03/exercise/style.css index 4163a3a..12b482b 100644 --- a/step1-03/exercise/style.css +++ b/step1-03/exercise/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-03/final/index.html b/step1-03/final/index.html index 9b5fcc3..4c5b24f 100644 --- a/step1-03/final/index.html +++ b/step1-03/final/index.html @@ -8,10 +8,10 @@

todos

- +
@@ -72,16 +72,16 @@ updateRemaining(); } - function filter(scope, button) { - document.querySelector('.active').classList.remove('active'); - button.classList.add('active'); + function filter(filterName, button) { + document.querySelector('.selected').classList.remove('selected'); + button.classList.add('selected'); for (let todo of document.querySelectorAll('.todo')) { const checked = todo.querySelector('input').checked == true; - if (scope == 'all') { + if (filterName == 'all') { todo.hidden = false; - } else if (scope == 'active') { + } else if (filterName == 'active') { todo.hidden = checked; - } else if (scope == 'completed') { + } else if (filterName == 'completed') { todo.hidden = !checked; } } diff --git a/step1-03/final/style.css b/step1-03/final/style.css index 4163a3a..12b482b 100644 --- a/step1-03/final/style.css +++ b/step1-03/final/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-04/README.md b/step1-04/README.md index 71bbf9f..64ab0ce 100644 --- a/step1-04/README.md +++ b/step1-04/README.md @@ -9,4 +9,4 @@ write index.html demo 'hello world' Write Counter Component with button -Demo Button, import into Component +Demo Button, import into Counter diff --git a/step1-04/demo/index.html b/step1-04/demo/index.html index 454cef5..e69de29 100644 --- a/step1-04/demo/index.html +++ b/step1-04/demo/index.html @@ -1,6 +0,0 @@ - - - -
- - diff --git a/step1-04/demo/src/App.tsx b/step1-04/demo/src/App.tsx index f3dc2af..e69de29 100644 --- a/step1-04/demo/src/App.tsx +++ b/step1-04/demo/src/App.tsx @@ -1,14 +0,0 @@ -import React from 'react'; -import { Counter } from './components/Counter'; - -export class App extends React.Component { - render() { - return ( -
-

My App

- - -
- ); - } -} diff --git a/step1-04/demo/src/components/Counter.tsx b/step1-04/demo/src/components/Counter.tsx index dd8fa71..c92694a 100644 --- a/step1-04/demo/src/components/Counter.tsx +++ b/step1-04/demo/src/components/Counter.tsx @@ -1,27 +1,11 @@ import React from 'react'; -import { Button } from './Button'; -export class Counter extends React.Component<{ text: string }, { counter: number }> { - constructor(props) { - super(props); - this.state = { - counter: 0 - }; - } +export class Counter extends React.Component { + render() { - const { counter } = this.state; - const { text } = this.props; + return ( -
- {text}: {counter} - -
+ ); } } diff --git a/step1-04/demo/src/index.tsx b/step1-04/demo/src/index.tsx index 1d9694f..e69de29 100644 --- a/step1-04/demo/src/index.tsx +++ b/step1-04/demo/src/index.tsx @@ -1,4 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { App } from "./App"; -ReactDOM.render(, document.getElementById("app")); diff --git a/step1-05/demo/src/style.css b/step1-05/demo/src/style.css index 4163a3a..12b482b 100644 --- a/step1-05/demo/src/style.css +++ b/step1-05/demo/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-05/exercise/src/components/TodoHeader.tsx b/step1-05/exercise/src/components/TodoHeader.tsx index ba9b8b0..15758b7 100644 --- a/step1-05/exercise/src/components/TodoHeader.tsx +++ b/step1-05/exercise/src/components/TodoHeader.tsx @@ -10,7 +10,7 @@ export class TodoHeader extends React.Component { diff --git a/step1-05/exercise/src/style.css b/step1-05/exercise/src/style.css index 4163a3a..12b482b 100644 --- a/step1-05/exercise/src/style.css +++ b/step1-05/exercise/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-05/final/src/components/TodoHeader.tsx b/step1-05/final/src/components/TodoHeader.tsx index ba9b8b0..15758b7 100644 --- a/step1-05/final/src/components/TodoHeader.tsx +++ b/step1-05/final/src/components/TodoHeader.tsx @@ -10,7 +10,7 @@ export class TodoHeader extends React.Component { diff --git a/step1-05/final/src/style.css b/step1-05/final/src/style.css index 4163a3a..12b482b 100644 --- a/step1-05/final/src/style.css +++ b/step1-05/final/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-06/demo/src/components/TodoHeader.tsx b/step1-06/demo/src/components/TodoHeader.tsx index b5622ea..f310531 100644 --- a/step1-06/demo/src/components/TodoHeader.tsx +++ b/step1-06/demo/src/components/TodoHeader.tsx @@ -15,7 +15,7 @@ export class TodoHeader extends React.Component { diff --git a/step1-06/demo/src/style.css b/step1-06/demo/src/style.css index 4163a3a..12b482b 100644 --- a/step1-06/demo/src/style.css +++ b/step1-06/demo/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-06/exercise/src/components/TodoHeader.tsx b/step1-06/exercise/src/components/TodoHeader.tsx index 408a91c..51830e9 100644 --- a/step1-06/exercise/src/components/TodoHeader.tsx +++ b/step1-06/exercise/src/components/TodoHeader.tsx @@ -17,9 +17,9 @@ export class TodoHeader extends React.Component {
); diff --git a/step1-06/exercise/src/style.css b/step1-06/exercise/src/style.css index 4163a3a..12b482b 100644 --- a/step1-06/exercise/src/style.css +++ b/step1-06/exercise/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-06/final/src/components/TodoHeader.tsx b/step1-06/final/src/components/TodoHeader.tsx index b63967b..dcf8947 100644 --- a/step1-06/final/src/components/TodoHeader.tsx +++ b/step1-06/final/src/components/TodoHeader.tsx @@ -12,9 +12,9 @@ export class TodoHeader extends React.Component { ); diff --git a/step1-06/final/src/style.css b/step1-06/final/src/style.css index 4163a3a..12b482b 100644 --- a/step1-06/final/src/style.css +++ b/step1-06/final/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-07/demo/src/components/TodoHeader.tsx b/step1-07/demo/src/components/TodoHeader.tsx index 7db8f6e..0608661 100644 --- a/step1-07/demo/src/components/TodoHeader.tsx +++ b/step1-07/demo/src/components/TodoHeader.tsx @@ -17,9 +17,9 @@ export class TodoHeader extends React.Component { ); diff --git a/step1-07/demo/src/style.css b/step1-07/demo/src/style.css index 4163a3a..12b482b 100644 --- a/step1-07/demo/src/style.css +++ b/step1-07/demo/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-07/exercise/src/components/TodoHeader.tsx b/step1-07/exercise/src/components/TodoHeader.tsx index 7db8f6e..0608661 100644 --- a/step1-07/exercise/src/components/TodoHeader.tsx +++ b/step1-07/exercise/src/components/TodoHeader.tsx @@ -17,9 +17,9 @@ export class TodoHeader extends React.Component { ); diff --git a/step1-07/exercise/src/style.css b/step1-07/exercise/src/style.css index 4163a3a..12b482b 100644 --- a/step1-07/exercise/src/style.css +++ b/step1-07/exercise/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; } diff --git a/step1-07/final/src/components/TodoHeader.tsx b/step1-07/final/src/components/TodoHeader.tsx index 3d7b234..b71dd25 100644 --- a/step1-07/final/src/components/TodoHeader.tsx +++ b/step1-07/final/src/components/TodoHeader.tsx @@ -25,13 +25,13 @@ export class TodoHeader extends React.Component { diff --git a/step1-07/final/src/style.css b/step1-07/final/src/style.css index 4163a3a..12b482b 100644 --- a/step1-07/final/src/style.css +++ b/step1-07/final/src/style.css @@ -31,7 +31,7 @@ h1 { border: none; } -.filter .active { +.filter .selected { border-bottom: 2px solid blue; }