-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add advise dialog form refactor #8
base: testing
Are you sure you want to change the base?
Add advise dialog form refactor #8
Conversation
…_g:benjacortesdev/pcn-website into benjacortedev/add-advise-dialog-form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tremendo Benja! Te dejo unos comments, quedo atento. Lo de parameter destructuring te lo mande por el hilo de Discord también
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buen trabajo @benjacortesdev! Te dejé review por el thread de Discord!
@agustin-sanc Estoy de acuerdo con lo que propusiste en Discord! Ahí lo implementé, comentame que te parece! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tremendo Benja! Me encantó como quedó el refactor! Dejé algunos comentarios mínimos para pulir algunas cosas y ya estamos para mergear
} | ||
|
||
export const AdviseForm = (props: AdviseFormProps) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deberíamos borrar esta línea en blanco porque es la primera línea dentro de la función o componente, y es una convención no dejar nunca esta línea en blanco. Lo mismo se aplica a diferentes tipos de bloques: clases, objetos, tipos, archivos, etc.
/> | ||
|
||
<Button type="submit" className="w-full"> | ||
{props.mode === "edit" ? "Guardar Cambios" : "Publicar"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para continuar con la convención de escritura que venimos usando, aquí deberíamos usar letra mayúscula sólo para la primera palabra en los botones
{props.mode === "edit" ? "Guardar Cambios" : "Publicar"} | |
{props.mode === "edit" ? "Guardar cambios" : "Publicar"} |
type EditFormProps = { | ||
mode: "edit", | ||
adviseId: string; | ||
isOpen: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Estamos usando la prop isOpen
para algo dentro de este componente?
export interface EditAdviseDialogProps { | ||
adviseId: string; | ||
initialContent: string; | ||
isOpen: boolean; | ||
setDialogOpen: (open: boolean) => void; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aquí estaría bueno que definamos esto como un type
en lugar de una interface
, sólo para seguir la misma convención que los tipos de las props de los otros componentes
Posible implementación para el Issue #7