mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-11-24 11:44:51 +03:00
Added proposal for implementing strikethrough feature for TODO app. (#50)
This commit is contained in:
parent
5bc505429f
commit
466a3a7739
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ stic.cabal
|
|||||||
/.dir-locals.el
|
/.dir-locals.el
|
||||||
stack*.yaml.lock
|
stack*.yaml.lock
|
||||||
/out
|
/out
|
||||||
|
*.swp
|
||||||
|
*.DS_Store
|
||||||
|
@ -38,6 +38,10 @@ page Main {
|
|||||||
<button onClick={() => this.setState({ taskFilter: task => !task.isDone })}> Active </button>
|
<button onClick={() => this.setState({ taskFilter: task => !task.isDone })}> Active </button>
|
||||||
<button onClick={() => this.setState({ taskFilter: task => task.isDone })}> Completed </button>
|
<button onClick={() => this.setState({ taskFilter: task => task.isDone })}> Completed </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button onClick=(tasks) => {// Change state.} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
jsx=},
|
jsx=},
|
||||||
|
|
||||||
@ -58,6 +62,11 @@ page Main {
|
|||||||
css=}
|
css=}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const toggleTasksDone = (tasks) => {
|
||||||
|
// If all tasks are done, set them all to active.
|
||||||
|
// Otherwise - set them all to false.
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This part is not currently supported at all.
|
// TODO: This part is not currently supported at all.
|
||||||
entity-form<Task> CreateTaskForm {
|
entity-form<Task> CreateTaskForm {
|
||||||
fields: {
|
fields: {
|
||||||
@ -78,5 +87,18 @@ entity-form<Task> CreateTaskForm {
|
|||||||
// TODO: This part is not currently supported at all.
|
// TODO: This part is not currently supported at all.
|
||||||
entity-list<Task> TaskList {
|
entity-list<Task> TaskList {
|
||||||
allowItemEditing: true,
|
allowItemEditing: true,
|
||||||
allowItemDeletion: true // Items can be deleted, and this also deletes them for real.
|
allowItemDeletion: true, // Items can be deleted, and this also deletes them for real.
|
||||||
|
|
||||||
|
fields: {
|
||||||
|
description: {
|
||||||
|
// The contract for render is: user can provide a function that:
|
||||||
|
// - receives a task as an input
|
||||||
|
// - returns a React Node or something that can be rendered by JSX
|
||||||
|
// - does not depend on any outer context
|
||||||
|
render: (task) => {
|
||||||
|
if (task.isDone) return (<s>task.description</s>)
|
||||||
|
return task.description
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user