mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-27 10:30:31 +00:00
feat(breadcrumb-element): show exact Validator Management breadcrumb
This commit is contained in:
parent
54aa9f7a9d
commit
ac43df845e
@ -1,3 +1,4 @@
|
||||
import { isValidElement } from 'react'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
import { XStack } from 'tamagui'
|
||||
import { ChevronRightIcon } from '@status-im/icons'
|
||||
@ -13,6 +14,16 @@ const BreadcrumbElement = ({
|
||||
breadcrumb,
|
||||
isLastElement,
|
||||
}: BreadcrumbElementProps) => {
|
||||
const getBreadcrumb = () => {
|
||||
if (
|
||||
isValidElement(breadcrumb) &&
|
||||
breadcrumb.props.children === 'Validator management'
|
||||
) {
|
||||
return 'Validator Management'
|
||||
}
|
||||
return breadcrumb
|
||||
}
|
||||
|
||||
return (
|
||||
<XStack space={'$2'} alignItems="flex-end">
|
||||
<NavLink
|
||||
@ -23,7 +34,7 @@ const BreadcrumbElement = ({
|
||||
fontWeight: isLastElement ? '500' : 'normal',
|
||||
}}
|
||||
>
|
||||
{breadcrumb}
|
||||
{getBreadcrumb()}
|
||||
</NavLink>
|
||||
{isLastElement === false && (
|
||||
<ChevronRightIcon size={20} color="#647084" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user