diff --git a/src/App.css b/src/App.css index c5c6e8a..9a877c3 100644 --- a/src/App.css +++ b/src/App.css @@ -1,17 +1,23 @@ .App { - text-align: center; + } .App-logo { animation: App-logo-spin infinite 20s linear; - height: 80px; + height: 95px; + margin-right: 20px; } +.app-title-wrapper { + display: flex; + align-items: center; +} .App-header { background-color: #222; - height: 150px; + height: 105px; padding: 20px; color: white; + padding-left: 40px; } .App-title { @@ -22,6 +28,35 @@ font-size: large; } +.todo-list { + padding: 50px; + padding-top: 10px; + width: 600px; +} +.todo-create-wrapper { + margin-bottom: 20px; +} +.todo-create-input { + padding: 12px 10px; + min-width: 300px; + display: inline-block; + box-shadow: 0px 0px 0px 2px rgba(69, 101, 173, 0.1); + border: none; + outline: none; + transition: all 0.3s ease; +} +.todo-create-input:hover, .todo-create-input:active, .todo-create-input:focus { + box-shadow: 0px 0px 0px 2px rgb(43, 190, 185); + box-shadow: 0px 0px 0px 2px #00ad9f; +} + +.todo-item { + padding: 15px 0; + display: flex; + align-items: center; + justify-content: space-between; +} + @keyframes App-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } diff --git a/src/App.js b/src/App.js index 117a53e..42c6dc4 100644 --- a/src/App.js +++ b/src/App.js @@ -20,9 +20,6 @@ class App extends Component { }) }) } - logState = () => { - console.log(this.state) - } saveTodo = (e) => { e.preventDefault(); const { todos } = this.state @@ -33,6 +30,9 @@ class App extends Component { return false } + // reset input + this.inputElement.value = '' + // Optimistically add todo to UI const temporaryValue = { data: { @@ -114,10 +114,19 @@ class App extends Component { return todos.map((todo, i) => { const { data, ref } = todo const id = getTodoId(todo) - console.log('id', id) + // only show delete button after create API response returns + let deleteButton + if (ref) { + deleteButton = ( + + ) + } return ( -
+ Using FaunaDB & netlify functions +
+- Using FaunaDB & netlify functions -
-