Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/module/src/NotAuthorized/NotAuthorized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface NotAuthorizedProps extends Omit<EmptyStateProps, 'children' | '
actions?: React.ReactNode;
/** Custom landing page button text */
toLandingPageText?: React.ReactNode;
/** Custom landing page button URL */
toLandingPageUrl?: string;
}

const useStyles = createUseStyles({
Expand All @@ -35,6 +37,7 @@ const useStyles = createUseStyles({
export const NotAuthorized: React.FunctionComponent<NotAuthorizedProps> = ({
prevPageButtonText = 'Return to previous page',
toLandingPageText = 'Go to landing page',
toLandingPageUrl = ".",
actions = null,
serviceName,
title = `You do not have access to ${serviceName}`,
Expand All @@ -60,7 +63,7 @@ export const NotAuthorized: React.FunctionComponent<NotAuthorizedProps> = ({
{prevPageButtonText}
</Button>
) : (
<Button variant="primary" component="a" href=".">
<Button variant="primary" component="a" href={toLandingPageUrl}>
{toLandingPageText}
</Button>
))}
Expand Down