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,6 +42,7 @@ export const ListEmptyState = ({
<Button variant="primary" onClick={onPrimaryAction}> <Button variant="primary" onClick={onPrimaryAction}>
{primaryActionText} {primaryActionText}
</Button> </Button>
{secondaryActions && (
<EmptyStateSecondaryActions> <EmptyStateSecondaryActions>
{secondaryActions.map((action) => ( {secondaryActions.map((action) => (
<Button <Button
@ -53,6 +54,7 @@ export const ListEmptyState = ({
</Button> </Button>
))} ))}
</EmptyStateSecondaryActions> </EmptyStateSecondaryActions>
)}
</EmptyState> </EmptyState>
</> </>
); );