UI housekeeping: Update Modal.children from JSX.Element to React.ReactNode, remove empty fragment wrappers (#41394)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Simplified modal structures across multiple dialog components for improved code maintainability. * Enhanced modal component's flexibility to support broader content types. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
+8
-10
@@ -431,16 +431,14 @@ export const SoftwareInstallDetailsModal = ({
|
||||
onEnter={onCancel}
|
||||
className={baseClass}
|
||||
>
|
||||
<>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
status={swInstallResult?.status}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRetry={onRetry}
|
||||
onCancel={onCancel}
|
||||
/>
|
||||
</>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
status={swInstallResult?.status}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRetry={onRetry}
|
||||
onCancel={onCancel}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
+8
-10
@@ -430,16 +430,14 @@ export const SoftwareIpaInstallDetailsModal = ({
|
||||
onEnter={onCancel}
|
||||
className={baseClass}
|
||||
>
|
||||
<>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRetry={onRetry}
|
||||
onCancel={onCancel}
|
||||
displayStatus={displayStatus}
|
||||
/>
|
||||
</>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRetry={onRetry}
|
||||
onCancel={onCancel}
|
||||
displayStatus={displayStatus}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
+8
-10
@@ -327,16 +327,14 @@ export const SoftwareScriptDetailsModal = ({
|
||||
onEnter={onCancel}
|
||||
className={baseClass}
|
||||
>
|
||||
<>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
installResultStatus={swInstallResult?.status}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRerun={onRerun}
|
||||
onCancel={onCancel}
|
||||
/>
|
||||
</>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
installResultStatus={swInstallResult?.status}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRerun={onRerun}
|
||||
onCancel={onCancel}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
+8
-10
@@ -271,16 +271,14 @@ const SoftwareUninstallDetailsModal = ({
|
||||
onEnter={onCancel}
|
||||
className={baseClass}
|
||||
>
|
||||
<>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
uninstallStatus={uninstallStatus}
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
onCancel={onCancel}
|
||||
onRetry={onRetry}
|
||||
hostSoftware={hostSoftware}
|
||||
/>
|
||||
</>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
uninstallStatus={uninstallStatus}
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
onCancel={onCancel}
|
||||
onRetry={onRetry}
|
||||
hostSoftware={hostSoftware}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
+8
-10
@@ -484,16 +484,14 @@ export const VppInstallDetailsModal = ({
|
||||
onEnter={onCancel}
|
||||
className={baseClass}
|
||||
>
|
||||
<>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRetry={onRetry}
|
||||
onCancel={onCancel}
|
||||
displayStatus={displayStatus}
|
||||
/>
|
||||
</>
|
||||
{renderContent()}
|
||||
<ModalButtons
|
||||
deviceAuthToken={deviceAuthToken}
|
||||
hostSoftwareId={hostSoftware?.id}
|
||||
onRetry={onRetry}
|
||||
onCancel={onCancel}
|
||||
displayStatus={displayStatus}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ type ModalWidth = "medium" | "large" | "xlarge" | "auto";
|
||||
|
||||
export interface IModalProps {
|
||||
title: string | JSX.Element;
|
||||
children: JSX.Element;
|
||||
children: React.ReactNode;
|
||||
onExit: () => void;
|
||||
onEnter?: () => void;
|
||||
/** medium 650px, large 800px, xlarge 850px, auto auto-width
|
||||
|
||||
Reference in New Issue
Block a user