Skip to content

Commit c556f63

Browse files
committed
chore: breadcrumbs refactoring of NestedBreadCrumb
1 parent 9bf2565 commit c556f63

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/Common/BreadCrumb/NestedBreadCrumb.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,20 @@ export const NestedBreadCrumb = ({ redirectUrl, linkText, profileName }: NestedB
99

1010
const breadcrumbs = [
1111
{ type: 'link', label: linkText, to: redirectUrl },
12-
{ type: 'link', label: 'Profiles', to: redirectUrl },
13-
{ type: 'text', label: profileName },
12+
...(profileName
13+
? [
14+
{ type: 'link', label: 'Profiles', to: redirectUrl },
15+
{
16+
type: 'text',
17+
label: profileName,
18+
},
19+
]
20+
: [
21+
{
22+
type: 'text',
23+
label: 'Create Profile',
24+
},
25+
]),
1426
]
1527

1628
return (

src/Common/BreadCrumb/Types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ export interface BreadcrumbTextProps {
5454
}
5555

5656
export interface NestedBreadCrumbProps {
57+
/**
58+
* It is the url to which the link should redirect
59+
*/
5760
redirectUrl: string
61+
/**
62+
* It is the text of the link
63+
*/
5864
linkText: string
65+
/**
66+
* It is the name of the profile
67+
* If not given, would show "Create Profile"
68+
*/
5969
profileName: string
6070
}

src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import { BuildInfraDescriptorProps } from './types'
2323
const Descriptor = ({
2424
additionalContainerClasses,
2525
children,
26+
tooltipNode,
2627
tippyInfoText,
2728
tippyAdditionalContent,
28-
tooltipNode,
2929
tooltipHeading,
3030
profileName,
3131
}: BuildInfraDescriptorProps) => (

0 commit comments

Comments
 (0)