Skip to content

Commit afdf6eb

Browse files
author
Nemobot
committed
Modal exposing loadingMessage and error
1 parent 867397d commit afdf6eb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Diff for: src/Modal/createModal.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export type ModalProps = {
2626
onClose: () => void;
2727
closeButtonLabel?: LocalizedString;
2828
isDestructive?: boolean;
29+
loadingMessage?: ActionsProps["loadingMessage"];
30+
error?: ActionsProps["error"];
2931
};
3032

3133
type ModalConfig = {
@@ -106,6 +108,8 @@ export function createModal(
106108
}
107109
secondaryAction={props.secondaryAction}
108110
size="large"
111+
loadingMessage={props.loadingMessage}
112+
error={props.error}
109113
/>
110114
</Inset>
111115
</Box>

Diff for: stories/Components/Modal.stories.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ export const WithActions = createStory({
3535
},
3636
});
3737

38+
export const WithError = createStory({
39+
children: [<Placeholder />],
40+
primaryAction: {
41+
label: formatMessage("Create"),
42+
onPress: action("Create"),
43+
},
44+
secondaryAction: {
45+
label: formatMessage("Cancel"),
46+
onPress: action("Cancel"),
47+
},
48+
error: formatMessage("Something went wrong"),
49+
});
50+
3851
export const Destructive = createStory({
3952
isDestructive: true,
4053
title: formatMessage("Delete item"),

0 commit comments

Comments
 (0)