Skip to content

Instantly share code, notes, and snippets.

@nataliaconde
Created February 20, 2023 20:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nataliaconde/42d4dcca7a232084f00c621a738d2a26 to your computer and use it in GitHub Desktop.
// components/Task.js
export default function Task(props) {
// ...
<CardActions>
{props.isDone ? (
<Button size="small" onClick={() => props.markTaskAsUndone(props.id)}>Mark as undone</Button>
) : (
<Button size="small" onClick={() => props.markTaskAsDone(props.id)}>Mark as done</Button>
)}
<Button size="small" onClick={() => props.deleteTask(props.id)}>Delete</Button>
</CardActions>
// ...
}
// Your final file should look like this:
// https://github.com/duplxey/back4app-containers-nextjs/blob/master/components/Task.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment