Skip to content

Commit d49125b

Browse files
authored
Merge pull request #30 from fhlavac/prop
Add toLandingPageUrl to NotAuthorized
2 parents 05bfb79 + a19e906 commit d49125b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/module/src/NotAuthorized/NotAuthorized.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export interface NotAuthorizedProps extends Omit<EmptyStateProps, 'children' | '
2222
actions?: React.ReactNode;
2323
/** Custom landing page button text */
2424
toLandingPageText?: React.ReactNode;
25+
/** Custom landing page button URL */
26+
toLandingPageUrl?: string;
2527
}
2628

2729
const useStyles = createUseStyles({
@@ -35,6 +37,7 @@ const useStyles = createUseStyles({
3537
export const NotAuthorized: React.FunctionComponent<NotAuthorizedProps> = ({
3638
prevPageButtonText = 'Return to previous page',
3739
toLandingPageText = 'Go to landing page',
40+
toLandingPageUrl = ".",
3841
actions = null,
3942
serviceName,
4043
title = `You do not have access to ${serviceName}`,
@@ -60,7 +63,7 @@ export const NotAuthorized: React.FunctionComponent<NotAuthorizedProps> = ({
6063
{prevPageButtonText}
6164
</Button>
6265
) : (
63-
<Button variant="primary" component="a" href=".">
66+
<Button variant="primary" component="a" href={toLandingPageUrl}>
6467
{toLandingPageText}
6568
</Button>
6669
))}

0 commit comments

Comments
 (0)