nguyenhoaikhang37 / df-frontend-2023

0 stars 0 forks source link

Submission for assignment 3 #3

Open nguyenhoaikhang37 opened 1 year ago

nguyenhoaikhang37 commented 1 year ago

// Demo link https://df-frontend-2023-pwyg.vercel.app/

// Any notes for reviewers If the code lacks clarify or if there are any issue with the application, please don't hesitate to provide feedback. I'm open to suggestions and eager to improve. Thanks a lot <3

tranduybau commented 12 months ago

You forgot to commit the new design

nguyenhoaikhang37 commented 12 months ago

You forgot to commit the new design

oh, thanks! When building on Vercel, I got an error with husky.

ngolapnguyen commented 11 months ago

Keep up the good work 👍

Requirements

Final result: ✅

Feedbacks

Your TS migration is on-point. I don't have much to offer except a couple of minor things:

  1. Typing for the form flows can be improved by reusing the Book interface. For example:
const handleAdd = (
    values: Omit<Book, 'id'> // which ends up with { title, author, genre }
  ) => { ... }

... or you can define your own set of form values:

export type BookFormValues = {
  title: string;
  ...
}

const defaultValues: BookFormValues = { ... }

... or you can use type inference:

export type BookFormValues = typeof defaultValues;

Different approaches.

  1. This assignment is submitted shortly after A2 so some issues here should also be subjected to my feedbacks for A2.