Merge pull request #167 from dlabaj/secondaryActionFix

Fixed build by making secondaryActions optional
This commit is contained in:
mfrances17 2020-10-12 16:47:12 -04:00 committed by GitHub
commit 3d16a021ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ export type ListEmptyStateProps = {
instructions: string; instructions: string;
primaryActionText: string; primaryActionText: string;
onPrimaryAction: MouseEventHandler<HTMLButtonElement>; onPrimaryAction: MouseEventHandler<HTMLButtonElement>;
secondaryActions: Action[]; secondaryActions?: Action[];
}; };
export const ListEmptyState = ({ export const ListEmptyState = ({
@ -42,17 +42,19 @@ export const ListEmptyState = ({
<Button variant="primary" onClick={onPrimaryAction}> <Button variant="primary" onClick={onPrimaryAction}>
{primaryActionText} {primaryActionText}
</Button> </Button>
<EmptyStateSecondaryActions> {secondaryActions && (
{secondaryActions.map((action) => ( <EmptyStateSecondaryActions>
<Button {secondaryActions.map((action) => (
key={action.text} <Button
variant={action.type || ButtonVariant.primary} key={action.text}
onClick={action.onClick} variant={action.type || ButtonVariant.primary}
> onClick={action.onClick}
{action.text} >
</Button> {action.text}
))} </Button>
</EmptyStateSecondaryActions> ))}
</EmptyStateSecondaryActions>
)}
</EmptyState> </EmptyState>
</> </>
); );