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

Consolidate Modal Forms #38

Open
navn-r opened this issue May 4, 2022 · 0 comments
Open

Consolidate Modal Forms #38

navn-r opened this issue May 4, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@navn-r
Copy link
Owner

navn-r commented May 4, 2022

Currently all modals except the calculator page use this custom hook for setting, clearing modal data. The hook doesn't have in built validation, so that is handled in the specific modal components. The general Modal component requires a tonne of functions to be passed as props for onSuccess and onDismiss. The current implementation can be more streamline.

export interface IModalProps {
  showModal?: boolean;
  onSuccess: (...args: any[]) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
  onDismiss: (...args: any[]) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
  title?: string;
  partial?: boolean;
  showSuccess?: boolean;
  cssClass?: string;
  children?: React.ReactNode;
}

Need to investigate good way to consolidate forms in React, with better validation and pre-population. Try https://formik.org/ and https://github.com/jquense/yup

@navn-r navn-r added enhancement New feature or request help wanted Extra attention is needed labels May 4, 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 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant