Conversation
| } | ||
|
|
||
| export function EmailForm({ onNext }: Props) { | ||
| const [email, setEmail] = useState(""); |
There was a problem hiding this comment.
lets install react hook form and zod (or other packages if you have better ones) for this to avoid having useStates cause that gets out of hand very quickly
There was a problem hiding this comment.
we can integrate with shadcn here too. They seem to support both react hook form and tanstack form so take your pick! https://ui.shadcn.com/docs/forms
| </button> | ||
| </form> | ||
| ); | ||
| } No newline at end of file |
There was a problem hiding this comment.
new line end of file please
| onChange={(e) => setEmail(e.target.value)} | ||
| required | ||
| /> | ||
| <button |
| color: var(--foreground); | ||
| font-family: Arial, Helvetica, sans-serif; | ||
| } | ||
|
|
There was a problem hiding this comment.
Could you set up a tailwind config and colors file? Guide: https://tailwindcss.com/docs/installation/framework-guides/nextjs
There was a problem hiding this comment.
All of our colors for the application should be defined in this file (e.g. primary, secondary, accent, etc) and then referenced by those names throughout all files
| </div> | ||
| </main> | ||
| ); | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please add newlines at the ends of all files
|
|
||
| async function createUserProject(userId: string, projectId: string) { | ||
| const existing = await prisma.userProject.findUnique({ | ||
| where: { userId_projectId: { userId, projectId } } |
| } | ||
|
|
||
| async function getUserProject(userId: string, projectId: string) { | ||
| return await prisma.userProject.findUnique({ |
There was a problem hiding this comment.
also move inline, anything this short can be inline
| }); | ||
| } | ||
|
|
||
| async function getUserProjects(filters?: { userId?: string, projectId?: string }) { |
There was a problem hiding this comment.
for simplicity, lets destructure the args in the function definition so go { userId?, projectId? } : { userId: ..., projectId: string } or however it goes
| } | ||
|
|
||
| async function deleteUserProject(userId: string, projectId: string) { | ||
| return await prisma.userProject.delete({ |
There was a problem hiding this comment.
do we have soft deletes for this or not on this one?
| }); | ||
| } | ||
|
|
||
| async function deleteUserProject(userId: string, projectId: string) { |
There was a problem hiding this comment.
this might be better off being named removeUserFromProject
Created lib/userProject.ts for managing the UserProject join table which contains: