Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anna's To do List-Typescript version #53

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3db8938
installed zustand, created task component and useTaskstore
Anna2024WebDev Nov 20, 2024
800e4ff
created tasklist and addtask component for the mapping of tasks and t…
Anna2024WebDev Nov 21, 2024
4ba1d73
changed colors on task notes, updated background, changed fonts and o…
Anna2024WebDev Nov 21, 2024
5142b8d
changed styling on button
Anna2024WebDev Nov 21, 2024
d6d93cf
Added count for total tasks and completed tasks in the useTaskStore, …
Anna2024WebDev Nov 22, 2024
66f6c43
added a condition to only display the counter container for tasks com…
Anna2024WebDev Nov 22, 2024
f9c4d6a
updated accessibility for checkbox
Anna2024WebDev Nov 22, 2024
996c48b
style fix
Anna2024WebDev Nov 22, 2024
922deea
changed fonts, added handlekey down function for the button, more sty…
Anna2024WebDev Nov 22, 2024
07e1f7a
added a favicon
Anna2024WebDev Nov 22, 2024
4148413
changed some styling, removed image, changed layout on mobile using f…
Anna2024WebDev Nov 22, 2024
51163b9
small fix
Anna2024WebDev Nov 22, 2024
98d352f
Update Task.jsx
Anna2024WebDev Nov 22, 2024
d753243
updated width and added max-width to task boxes and added font awesom…
Anna2024WebDev Nov 23, 2024
cf48fc4
Merge branch 'main' of https://github.com/Anna2024WebDev/project-to-d…
Anna2024WebDev Nov 23, 2024
58229e9
added validation for button click and keydown press so no empty tasks…
Anna2024WebDev Nov 23, 2024
e3510ca
updated readme and cleaned up code
Anna2024WebDev Nov 23, 2024
a7b4418
changed color on task container and other CSS fix
Anna2024WebDev Nov 24, 2024
21a3b7b
deleted unused img
Anna2024WebDev Nov 24, 2024
0ad1a8a
added more box shadow to task container
Anna2024WebDev Nov 24, 2024
524f725
changed box-shadow for a more 3d effect on the post its/task container
Anna2024WebDev Nov 25, 2024
b6627fc
changed colors
Anna2024WebDev Nov 25, 2024
81c6df2
changed font colors in header, check-mark img and taskcontainer, also…
Anna2024WebDev Nov 25, 2024
664f452
added attribution to flaticon for the usage of img
Anna2024WebDev Nov 25, 2024
343b412
cleaned up
Anna2024WebDev Nov 25, 2024
426e420
removed redundant code and comments
Anna2024WebDev Nov 27, 2024
dda5c26
initial commit
Anna2024WebDev Nov 27, 2024
d39aff9
added interface Task and interface TaskStore
Anna2024WebDev Nov 27, 2024
5a169c6
updated AddTask.tsx file for the handlekeydown event, TaskStore incl …
Anna2024WebDev Nov 28, 2024
a04e971
updated typescript in addTask
Anna2024WebDev Nov 28, 2024
5f08d4e
Fixed conversion in Task.tsx and AddTask
Anna2024WebDev Nov 28, 2024
093f4fa
updated index.html with main.tsx
Anna2024WebDev Nov 28, 2024
ea007c7
try fixing errors
Anna2024WebDev Nov 28, 2024
7b2a507
fix
Anna2024WebDev Nov 28, 2024
d3dcdf4
cleaned up
Anna2024WebDev Nov 28, 2024
53a344c
fixed the problem with the declarations file and the extra comma afte…
Anna2024WebDev Nov 28, 2024
39a02a0
removed border-radius on taskcontainer
Anna2024WebDev Dec 3, 2024
1a71214
removed comments
Anna2024WebDev Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changed fonts, added handlekey down function for the button, more sty…
…ling fix
  • Loading branch information
Anna2024WebDev committed Nov 22, 2024
commit 922deea5fb2c1512027e1cc40cc21341df1d69a6
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Anton&family=Inconsolata:[email protected]&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Reenie+Beanie&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Anton&family=Inconsolata:[email protected]&family=Indie+Flower&family=Kosugi+Maru&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Reenie+Beanie&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Todos App Context API</title>
</head>
8 changes: 8 additions & 0 deletions src/components/AddTask.jsx
Original file line number Diff line number Diff line change
@@ -84,6 +84,13 @@ export const AddTask = () => {
const totalTasks = getTotalTasks();
const completedTasks = getCompletedTasks();

// Handle Enter key to submit the form
const handleKeyDown = (event) => {
if (event.key === "Enter") {
handleSubmit(event);
}
};

return (
<div className="add-task">
<Form onSubmit={handleSubmit}>
@@ -96,6 +103,7 @@ export const AddTask = () => {
name="addTask"
value={title}
onChange={(event) => setTitle(event.target.value)}
onKeyDown={handleKeyDown} // Listen for the Enter key press
rows="2"
cols="40"
placeholder="New task..."
17 changes: 9 additions & 8 deletions src/components/Task.jsx
Original file line number Diff line number Diff line change
@@ -28,18 +28,18 @@ const CheckMark = styled.i`
`

const H2 = styled.h2`
font-size: 30px;
font-family: "Reenie Beanie";
font-weight: 600;
font-size: 20px;
font-family: "Indie Flower", cursive;
font-weight: 500;
text-align: center;
margin: 0;
`
const StyledP = styled.p`
font-size: 18px;
font-family: "Reenie Beanie";
font-weight: 500;
font-size: 11px;
font-family: "Poppins";
font-weight: 400;
margin: 0;
text-align: left; /* Centers text within the container */
text-align: left;
`

const TrashIcon = styled.i`
@@ -77,7 +77,8 @@ export const Task = ({ task }) => {
className="fa fa-trash-o"
onClick={() => removeTask(task.id)}
/>
<StyledP>Created: {new Date(task.createdAt).toLocaleString()}</StyledP>
<StyledP>Created: {new Date(task.createdAt).toLocaleDateString("en-GB")} at {new Date(task.createdAt).toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" })}</StyledP>
{/* "en-gb" gives the date in the format dd/mm/yyyy (or your region's default date format. */}
</TaskContainer>
);
};