-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
style(preview-deployment): better preview deployment card #938
Conversation
export function PreviewDeploymentCard({ | ||
appName, | ||
serverId, | ||
|
||
onDeploymentDelete, | ||
deploymentId, | ||
deployments, | ||
|
||
domainId, | ||
domainHost, | ||
|
||
pullRequestTitle, | ||
pullRequestUrl, | ||
isLoading, | ||
status, | ||
branch, | ||
date, | ||
}: PreviewDeploymentCardProps) { | ||
return ( |
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.
I feel is better to just pass the deploymentId and the serverId, and then inside the component use this hook
const { data: previewDeployment } = api.previewDeployment.one.useQuery({ previewDeploymentId: previewDeploymentId, });
In this way we avoid passing too many props, and thus isolate the component in a more elegant way.
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.
i think we must left onDeploymentDelete
because we need the to refetch deployments when deleting one & isLoading
on deleting.
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.
I think we can also abstract and put the handleDeletePreviewDeployment
inside the preview-deployment-card.tsx
in this case we reduce the props we need to pass, we remove the isLoading and the onDeploymentDelete prop
I preferred to put the component directly into PreviewDeployemtsView, because with a separate component, there were too many problems with the |
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.
Don't worry, I think it's easier to understand this way thanks!
Dark
Light