Skip to content

Commit

Permalink
Fix onClose method for DiscoverySourceSetupModal (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Ondra Machacek <[email protected]>
Co-authored-by: Montse Ortega <[email protected]>
  • Loading branch information
machacekondra and ammont82 authored Nov 13, 2024
1 parent f8ff6f1 commit bc19725
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ export const sshPublicKeyValidationSchema = Yup.string().test(
},
);

export interface DiscoverySourceSetupModalProps {
isOpen?: boolean;
isDisabled?: boolean;
onClose: () => void;
onSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace DiscoverySourceSetupModal {
export type Props = {
isOpen?: boolean;
isDisabled?: boolean;
onClose?: ((event: KeyboardEvent | React.MouseEvent) => void) | undefined;
onSubmit: React.FormEventHandler<HTMLFormElement> | undefined;
};
}

// Your component
export const DiscoverySourceSetupModal: React.FC<DiscoverySourceSetupModalProps> = (props) => {
export const DiscoverySourceSetupModal: React.FC<
DiscoverySourceSetupModal.Props
> = (props) => {
const { isOpen = false, isDisabled = false, onClose, onSubmit } = props;

const [sshKey, setSshKey] = useState("");
Expand Down

0 comments on commit bc19725

Please sign in to comment.