Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1,100 changes: 1,092 additions & 8 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/material": "^5.14.18",
"react": "^18.1.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.1.0",
"react-scripts": "5.0.1"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions project-walkthrough
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Updating the first task in the this.state.tasks array

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can explain the purpose of this document?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No purpose


/** TaskUpdate Component Modifications
* In TaskUpdate.js, our constructor is modified as follows */
class TaskUpdate {
constructor(props) {
super(props);

this.state = {
title: this.props.title,
task: this.props.task,
};
// we initialize local state of 'TaskUpdate' with the 'title' and 'task' from the props
// this ensures that the input fields in the update form display the current values of the task being updated
}
}

// handleSubmit function
handleSubmit = (e) => {
e.preventDefault();

const updatedTask = {
title: this.state.title,
task: this.state.task,
};

this.props.updateTask(this.props.id, updatedTask);

this.props.updateTask(this.props.id, updatedTask);

// Close the update form by calling the callback function
this.props.onUpdateComplete();
};
/** Everytime the update button is clicked and the update form is submitted, we create an 'updatedTask' object with the new 'title' and 'task' values from the local state
*
*/

// Delete Logic

/** Defining handleDeleteClick Method in Task.js
* handleDeleteClick = () =>{
* this.props.deleteTask(this.props.id)
* }
* Inside the handleDeleteClick function, you can call a deleteTask function that is passed as a prop from TaskList.js
*/

/** Passing the deleteTask function as a prop in the render method
* <Task
key={task.id}
{...task}
updateTask={this.updateTask}
deleteTask={this.deleteTask}
/>
*/

/** Handling deletion in deleteTask function
* deleteTask = (id) => {
this.setState((prevState)=>{
const updatedTasks = prevState.tasks.filter((task)=>{
task.id !== id
return { tasks: updatedTasks }
})
})
}

deleteTask takes in the id argument which is the id of the task to be deleted

this.setState() method is called to update the state in the TaskList Component and it takes the previous state (prevState) as an argument to update the current state based on its previous value

we declare an updatedTasks variable which is assigned the result of the filter method applied to the prevState.tasks array
filter() creates a new array by iterating over the original array's elements and including only those that meet a certain condition (excludes task with specific id -> task.id !== id)

Finally, this.setState returns an object with property tasks set to updatedTasks, which does not have the deleted task
*/
23 changes: 20 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link
href="https://fonts.googleapis.com/css2?family=Lobster&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
integrity="sha384-GLhlTQ8iWSevFYlK89irb/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jpZZ"
crossorigin="anonymous"
/>

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -15,6 +26,11 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css"
rel="stylesheet"
/>

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -28,8 +44,9 @@
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<div class="background-container">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a bootstrap class? If not, what purpose does it serve? I don't see any styling anywhere for it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used it but deleted the css

<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

Expand All @@ -38,6 +55,6 @@

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
--></div>
</body>
</html>
108 changes: 97 additions & 11 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,105 @@
.App {
text-align: center;
/* App.css */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted

.app-container {
display: flex;
flex-direction: column;
height: 100vh; /* height of 100vh ensures that the layout spans the full height */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted

}

.App-logo {
height: 40vmin;
pointer-events: none;
.task-list,
.task-in-progress,
.task-in-review,
.task-completed {
flex: 1; /* Equal distribution of space */
box-sizing: border-box; /* Include padding and border in the width calculation */
width: calc(33.33% - 40px); /* 33.33% width with 20px margin on each side */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems responsive but might not actually be. 40px on a mobile screen might be a lot.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test it out

margin: 20px 20px;
border: 1px solid #ccc;
padding: 16px;
border-radius: 12px;
opacity: 80%;
font-size: 27px;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
.task-container {
display: flex;
flex-direction: column;
align-items: center;
flex: 1; /* This allows the task components to take up the available space */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you had a comment about this property already above

}

.header-2 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think naming things with *-# is not exactly good. I would rather describe where the header is located or what kind of header it is instead of giving numbers

margin: 20px;
}

.task-list {
background: #e97e7e;
}

.task-in-progress {
background: cyan;
}

.task-in-review {
background: rgb(244, 244, 162);
}

.task-completed {
background: rgb(146, 246, 153);
}

.task-composer {
margin: 20px 0px 50px;
}

/* Style the Header as you need it. For example: */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

.header {
/* background: #333; */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove commented-out code before pushing

color: #fff;
font-size: 35px;
display: flex; /* flex container to enable */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

padding: 10px;
justify-content: center;
font-size: calc(10px + 2vmin);
align-items: center;
opacity: 30%;
}

.header-link {
color: white;
}

.content {
color: black;
}

.main {
opacity: 80%;
}

.buttons {
margin: 10px;
margin-bottom: 20px;
border-radius: 25%;
}

button {
margin-top: 15px;
border-radius: 25%;
}

.adjustments {
margin-bottom: 50px;
}

form input[type="text"],
form input[type="email"],
/* Add more selectors for other input types if needed */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

form input[type="submit"] {
border-radius: 8px; /* Adjust the value as needed */
/* Other styling properties */
/* For example: */
Comment on lines +95 to +97

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comments

border: 1px solid #ccc;
padding: 8px;
margin-bottom: 10px;
}

form textarea[type="text"] {
border-radius: 8px;
}
Loading