Skip to content

Commit

Permalink
Add footer and clean up, looking good
Browse files Browse the repository at this point in the history
  • Loading branch information
justthinguyen committed Oct 19, 2023
1 parent d5f88cc commit 3e69136
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
17 changes: 17 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,21 @@ body {
cursor: pointer;
background: none;
font-size: 1rem;
}

footer {
position: fixed;
bottom: 5px;
left: 20%;
right: 20%;
text-align: center;
}

.footerText {
font-family: monospace;
}

footer a {
text-decoration: none;
color: #9a5a89;
}
6 changes: 5 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { Todo } from './TodoItem';
import { TodoList } from './TodoList';
import { sampleTodos } from './data';
Expand Down Expand Up @@ -43,6 +43,10 @@ function App() {
return (
<div className="app" data-width={dimensions.width}>
<TodoList todos={todos} name={todoName} onNameChange={setTodoName} setTodos={setTodos} />
<footer>
<div className='footerText'>🌱 Inspired by the <a href='https://github.com/ngthing/toododo' target='blank'>Internet</a>.
Made by <a href='https://justthinguyen.com' target='blank'>Thi Nguyen</a>. Thanks for stopping by and have a beautiful day! 🌱</div>
</footer>
</div >
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/TodoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const todoTextareaHeight = (content: string): number => {
// it works! muahaha - why these formula and numbers - no comment.
// but 25px is the min width i want to set.
const x = 25 + Math.floor(content.length * 12 / window.innerWidth) * 25;
console.log([window.innerWidth, content.length, x])
// console.log([window.innerWidth, content.length, x])
return x;
}

Expand Down

0 comments on commit 3e69136

Please sign in to comment.