Skip to content

Commit

Permalink
Merge pull request #30 from fhlavac/prop
Browse files Browse the repository at this point in the history
Add toLandingPageUrl to NotAuthorized
  • Loading branch information
Hyperkid123 authored Jul 7, 2023
2 parents 05bfb79 + a19e906 commit d49125b
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit d49125b

Please sign in to comment.