Skip to content

Commit

Permalink
Remove error arg from errorMessageImpl components.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnrudd committed Dec 27, 2024
1 parent 97d3144 commit a5b88d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions cmp/error/ErrorMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,12 @@ export const [ErrorMessage, errorMessage] = hoistCmp.withFactory<ErrorMessagePro
...rest,
item: XH.isMobileApp
? mobileErrorMessageImpl({
error,
message,
title,
actionButtonProps,
detailsButtonProps
})
: desktopErrorMessageImpl({
error,
message,
title,
actionButtonProps,
Expand Down
8 changes: 5 additions & 3 deletions desktop/cmp/error/impl/ErrorMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import '@xh/hoist/desktop/register';
* Desktop implementation of ErrorMessage.
* @internal
*/
export const errorMessageImpl = hoistCmp.factory<ErrorMessageProps>({
render({error, message, title, actionButtonProps, detailsButtonProps}) {
export const errorMessageImpl = hoistCmp.factory<
Omit<ErrorMessageProps, 'error' | 'actionFn' | 'detailsFn'>
>({
render({message, title, actionButtonProps, detailsButtonProps}) {
let buttons = [],
buttonBar = null;
if (detailsButtonProps) buttons.push(detailsButton(detailsButtonProps as ButtonProps));
Expand All @@ -31,7 +33,7 @@ export const errorMessageImpl = hoistCmp.factory<ErrorMessageProps>({

return div({
className: 'xh-error-message__inner',
items: [titleCmp({title}), messageCmp({message, error}), buttonBar]
items: [titleCmp({title}), messageCmp({message}), buttonBar]
});
}
});
Expand Down
8 changes: 5 additions & 3 deletions mobile/cmp/error/impl/ErrorMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import '@xh/hoist/mobile/register';
* Mobile implementation of ErrorMessage.
* @internal
*/
export const errorMessageImpl = hoistCmp.factory<ErrorMessageProps>({
render({error, message, title, actionButtonProps, detailsButtonProps}) {
export const errorMessageImpl = hoistCmp.factory<
Omit<ErrorMessageProps, 'error' | 'actionFn' | 'detailsFn'>
>({
render({message, title, actionButtonProps, detailsButtonProps}) {
let buttons = [],
buttonBar = null;
if (detailsButtonProps) buttons.push(detailsButton(detailsButtonProps as ButtonProps));
Expand All @@ -31,7 +33,7 @@ export const errorMessageImpl = hoistCmp.factory<ErrorMessageProps>({

return div({
className: 'xh-error-message__inner',
items: [titleCmp({title}), messageCmp({message, error}), buttonBar]
items: [titleCmp({title}), messageCmp({message}), buttonBar]
});
}
});
Expand Down

0 comments on commit a5b88d2

Please sign in to comment.