|
8 | 8 | Box,
|
9 | 9 | Column,
|
10 | 10 | Columns,
|
11 |
| - Inset, |
12 | 11 | Actions,
|
13 |
| - Stack, |
14 | 12 | } from "..";
|
15 | 13 | import { useOverlay, usePreventScroll, useModal } from "@react-aria/overlays";
|
16 | 14 | import { useDialog } from "@react-aria/dialog";
|
@@ -103,40 +101,50 @@ export function Modal(props: Props) {
|
103 | 101 |
|
104 | 102 | return (
|
105 | 103 | <CustomModal {...props} aria-label={props.title}>
|
106 |
| - <Inset spaceX={config.paddingX} spaceY={config.paddingY}> |
107 |
| - <Stack space={config.internalSpacing}> |
108 |
| - <Columns space={16} alignY="top"> |
109 |
| - <Columns space={16} alignY="center"> |
110 |
| - {icon && <Column width="content">{icon}</Column>} |
111 |
| - <Title size={config.titleSize}>{props.title}</Title> |
112 |
| - </Columns> |
113 |
| - <Column width="content"> |
114 |
| - <IconButton |
115 |
| - icon={config.closeIcon} |
116 |
| - label={props.closeButtonLabel ?? defaultMessages.Modal.closeButtonLabel} |
117 |
| - onPress={props.onClose} |
118 |
| - size={config.closeIconSize} |
119 |
| - tabIndex={-1} |
120 |
| - kind="transparent" |
121 |
| - hierarchy="secondary" |
122 |
| - /> |
123 |
| - </Column> |
| 104 | + <Box |
| 105 | + paddingX={config.paddingX} |
| 106 | + paddingTop={config.paddingY} |
| 107 | + paddingBottom={config.internalSpacing} |
| 108 | + > |
| 109 | + <Columns space={16} alignY="top"> |
| 110 | + <Columns space={16} alignY="center"> |
| 111 | + {icon && <Column width="content">{icon}</Column>} |
| 112 | + <Title size={config.titleSize}>{props.title}</Title> |
124 | 113 | </Columns>
|
125 |
| - <Box className={modalBody}>{props.children}</Box> |
126 |
| - <Actions |
127 |
| - primaryAction={ |
128 |
| - props.primaryAction |
129 |
| - ? { ...props.primaryAction, isDestructive: kind === "destructive" } |
130 |
| - : undefined |
131 |
| - } |
132 |
| - secondaryAction={props.secondaryAction} |
133 |
| - size={config.actionsSize} |
134 |
| - loadingMessage={props.loadingMessage} |
135 |
| - error={props.error} |
136 |
| - errorBannerWidth={props.errorBannerWidth || config.defaultErrorBannerWidth} |
137 |
| - /> |
138 |
| - </Stack> |
139 |
| - </Inset> |
| 114 | + <Column width="content"> |
| 115 | + <IconButton |
| 116 | + icon={config.closeIcon} |
| 117 | + label={props.closeButtonLabel ?? defaultMessages.Modal.closeButtonLabel} |
| 118 | + onPress={props.onClose} |
| 119 | + size={config.closeIconSize} |
| 120 | + tabIndex={-1} |
| 121 | + kind="transparent" |
| 122 | + hierarchy="secondary" |
| 123 | + /> |
| 124 | + </Column> |
| 125 | + </Columns> |
| 126 | + </Box> |
| 127 | + <Box className={modalBody} paddingX={config.paddingX}> |
| 128 | + {props.children} |
| 129 | + </Box> |
| 130 | + <Box |
| 131 | + paddingX={config.paddingX} |
| 132 | + paddingTop={config.internalSpacing} |
| 133 | + paddingBottom={config.paddingY} |
| 134 | + > |
| 135 | + <Actions |
| 136 | + primaryAction={ |
| 137 | + props.primaryAction |
| 138 | + ? { ...props.primaryAction, isDestructive: kind === "destructive" } |
| 139 | + : undefined |
| 140 | + } |
| 141 | + secondaryAction={props.secondaryAction} |
| 142 | + size={config.actionsSize} |
| 143 | + loadingMessage={props.loadingMessage} |
| 144 | + error={props.error} |
| 145 | + errorBannerWidth={props.errorBannerWidth || config.defaultErrorBannerWidth} |
| 146 | + /> |
| 147 | + </Box> |
140 | 148 | </CustomModal>
|
141 | 149 | );
|
142 | 150 | }
|
|
0 commit comments