Merge pull request #167 from dlabaj/secondaryActionFix
Fixed build by making secondaryActions optional
This commit is contained in:
commit
3d16a021ea
1 changed files with 14 additions and 12 deletions
|
@ -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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue