Files
tom goriunovandGitHub bc291d93c5 Navigation: horizontal layout (#1991)
* add ENV for navigation layout type

* add network menu to top bar

* renaming and main component placeholder

* add logo, testnet badge, login and connect wallet buttons to the nav bar

* refactor once more

* styles for nav link group

* style nav link

* style groupped nav links

* update values for L2 review

* update demo values

* fix deployment values for L2 review

* tests

* fix prop collision

* shorten filter input on marketplace page and update MainArea height

* change margin between text and lightning label

* add active state to "Other" nav menu

* popover fixes

* fix link width

* [skip ci] update demo values
2024-06-19 15:58:13 +02:00

26 lines
678 B
TypeScript

import { chakra } from '@chakra-ui/react';
import React from 'react';
import type { NavItem, NavGroupItem } from 'types/client/navigation';
import IconSvg from 'ui/shared/IconSvg';
interface Props {
className?: string;
item: NavItem | NavGroupItem;
}
const NavLinkIcon = ({ item, className }: Props) => {
if ('icon' in item && item.icon) {
return <IconSvg className={ className } name={ item.icon } boxSize="30px" flexShrink={ 0 }/>;
}
if ('iconComponent' in item && item.iconComponent) {
const IconComponent = item.iconComponent;
return <IconComponent className={ className } size={ 30 }/>;
}
return null;
};
export default chakra(NavLinkIcon);