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

ui/simplelistpage: use Component type for createForm #2458

Closed
Forfold opened this issue Jun 17, 2022 · 2 comments
Closed

ui/simplelistpage: use Component type for createForm #2458

Forfold opened this issue Jun 17, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Forfold
Copy link
Contributor

Forfold commented Jun 17, 2022

In a PR (#2434) converting a Dialog component to Typescript rendered as a child of SimpleListPage component was forced to set the onClose prop to optional, because in SimpleListPage we clone the passed Dialog component and then append the onClose property to props.

We should think about setting onClose to required for our Dialog components, which would require SimpleListPage to accept a Component instead of a JSX.Element.

E.g.

<SimpleListPage
  createForm={<RotationCreateDialog />}
/>

would change to

<SimpleListPage
  createDialogComponent={RotationCreateDialog}
/>

and we could add a render prop option, too, if some components need to pull off some shenanigans in scope as well:

<SimpleListPage
  renderCreateDialog={(props) => <RotationCreateDialog foo={bar} {...props} />}
/>
@Forfold Forfold added the enhancement New feature or request label Jun 17, 2022
@tony-tvu tony-tvu self-assigned this Jun 22, 2022
@tony-tvu
Copy link
Collaborator

#2467

@KatieMSB
Copy link
Collaborator

KatieMSB commented Dec 5, 2022

Completed in #2467

@KatieMSB KatieMSB closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants