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

feat: add todo list app example #3

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open

Conversation

karim-hajouan
Copy link
Collaborator

No description provided.

karim-hajouan and others added 30 commits June 7, 2023 12:04
examples/nextjs-todo/pages/index.tsx Outdated Show resolved Hide resolved
examples/nextjs-todo/pages/index.tsx Outdated Show resolved Hide resolved
examples/nextjs-todo/components/ui/TodoForm.tsx Outdated Show resolved Hide resolved
examples/nextjs-todo/components/ui/TodoForm.tsx Outdated Show resolved Hide resolved
Comment on lines +60 to +85
>
{fields && (
<Form
fields={fields}
onSubmit={(values: TUnit) => handleCheck(values)}
components={{
string: (props) => <input {...props} type="text" />,
}}
>
{({ fields }) => (
<div>
<FormField
id="done"
render={(props) => (
<Button
{...props}
onClick={(e) => {
props.onChange(!props.value);
onSubmit();
}}
className="absolute border border-black p-0 w-6 h-6 rounded-full -top-2 -right-2 bg-white"
>
{done ? (
<div className="bg-black w-3 h-3 rounded-full" />
) : null}
</Button>
Copy link
Member

Choose a reason for hiding this comment

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

Since you want to handle just done we can avoid to call the struct and use fields here

Comment on lines +26 to +33
if (!client.project && context.req.url !== "/get-started")
return {
redirect: {
destination: "/get-started",
permanent: false,
},
};

Copy link
Member

Choose a reason for hiding this comment

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

Can you please remove it? It's something that i forgot in there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants