File tree Expand file tree Collapse file tree 8 files changed +18
-18
lines changed
features/TimeHistory/ui/RouteItem Expand file tree Collapse file tree 8 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 11import { useState , useEffect } from 'react' ;
2- import itemsMenu from 'src/utils/appsMenu' ;
2+ import getMenuItems from 'src/utils/appsMenu' ;
33import styles from './CircularMenu.module.scss' ;
44import { MenuItem } from 'src/types/menu' ;
55import { useLocation } from 'react-router-dom' ;
@@ -17,7 +17,7 @@ declare module 'react' {
1717function CircularMenu ( { circleSize } ) {
1818 const [ activeItem , setActiveItem ] = useState < MenuItem | null > ( null ) ;
1919 const chunkSize = 7 ;
20- const linkChunks = _ . chunk ( itemsMenu ( ) , chunkSize ) ;
20+ const linkChunks = _ . chunk ( getMenuItems ( ) , chunkSize ) ;
2121 const location = useLocation ( ) ;
2222
2323 const calculateDiameter = ( index , circleSize ) => {
@@ -44,7 +44,7 @@ function CircularMenu({ circleSize }) {
4444 } ;
4545
4646 useEffect ( ( ) => {
47- const activeMenuItem = itemsMenu ( ) . find ( ( item ) => isActiveItem ( item ) ) ;
47+ const activeMenuItem = getMenuItems ( ) . find ( ( item ) => isActiveItem ( item ) ) ;
4848 setActiveItem ( activeMenuItem || null ) ;
4949 } , [ location ] ) ;
5050
Original file line number Diff line number Diff line change 11import { useState , useRef } from 'react' ;
22import { useLocation , NavLink } from 'react-router-dom' ;
3- import itemsMenu from 'src/utils/appsMenu' ;
3+ import getMenuItems from 'src/utils/appsMenu' ;
44import styles from './MobileMenu.module.scss' ;
55import { MenuItem } from 'src/types/menu' ;
66import cx from 'classnames' ;
@@ -30,7 +30,7 @@ const MobileMenu = () => {
3030 } ;
3131
3232 const getActiveItem = ( ) => {
33- return itemsMenu ( ) . find ( ( item ) => isActiveItem ( item ) ) || null ;
33+ return getMenuItems ( ) . find ( ( item ) => isActiveItem ( item ) ) || null ;
3434 } ;
3535
3636 const activeItem = getActiveItem ( ) ;
@@ -53,7 +53,7 @@ const MobileMenu = () => {
5353 alt = { `${ activeItem ?. name } menu active icon` }
5454 />
5555 </ button >
56- { itemsMenu ( ) . map ( ( item , index ) => {
56+ { getMenuItems ( ) . map ( ( item , index ) => {
5757 const isExternal = item . to . startsWith ( 'http' ) ;
5858 return (
5959 ! isActiveItem ( item ) && (
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { useLocation } from 'react-router-dom';
22import { CHAIN_ID } from 'src/constants/config' ;
33import { PATTERN_CYBER } from 'src/constants/patterns' ;
44import { routes } from 'src/routes' ;
5- import itemsMenu from 'src/utils/appsMenu' ;
5+ import getMenuItems from 'src/utils/appsMenu' ;
66import findApp from 'src/utils/findApp' ;
77import { Helmet } from 'react-helmet' ;
88import styles from './AppName.module.scss' ;
@@ -20,7 +20,7 @@ function AppName() {
2020 : findItem ;
2121 }
2222
23- const value = findApp ( itemsMenu ( ) , pathname ) ;
23+ const value = findApp ( getMenuItems ( ) , pathname ) ;
2424
2525 const content = value [ 0 ] ?. name || CHAIN_ID ;
2626
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ const findSelectAppByUrl = (
1212 let pathname = url ;
1313 const isRobot = url . includes ( '@' ) || url . includes ( 'neuron/' ) ;
1414
15- const itemsMenuObj = reduceRobotSubItems ( passport , address ) ;
15+ const getMenuItemsObj = reduceRobotSubItems ( passport , address ) ;
1616
1717 if ( isRobot ) {
1818 pathname = routes . robot . path ;
1919 }
2020
21- const value = findApp ( itemsMenuObj , pathname ) ;
21+ const value = findApp ( getMenuItemsObj , pathname ) ;
2222
2323 return value ;
2424} ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Nullable, Option } from 'src/types';
44import { Citizenship } from 'src/types/citizenship' ;
55import { MenuItem , MenuItems } from 'src/types/menu' ;
66import { Networks } from 'src/types/networks' ;
7- import itemsMenu from 'src/utils/appsMenu' ;
7+ import getMenuItems from 'src/utils/appsMenu' ;
88
99const reduceRobotSubItems = (
1010 passport : Nullable < Citizenship > ,
@@ -19,7 +19,7 @@ const reduceRobotSubItems = (
1919 linkApp = routes . neuron . getLink ( address ) ;
2020 }
2121
22- return itemsMenu ( ) . reduce ( ( acc : MenuItems , item : MenuItem ) => {
22+ return getMenuItems ( ) . reduce ( ( acc : MenuItems , item : MenuItem ) => {
2323 if ( item . to === routes . robot . path ) {
2424 item . subItems = ! linkApp
2525 ? [ ]
Original file line number Diff line number Diff line change 1- import itemsMenu from 'src/utils/appsMenu' ;
1+ import getMenuItems from 'src/utils/appsMenu' ;
22import DEFAULT_IMG from 'images/large-orange-circle.png' ;
33import { Link } from 'react-router-dom' ;
44import findApp from 'src/utils/findApp' ;
@@ -7,7 +7,7 @@ import styles from './RouteItem.module.scss';
77
88function RouteItem ( { value } : { value : RouteItemT } ) {
99 const { url } = value ;
10- const app = findApp ( itemsMenu ( ) , url ) ;
10+ const app = findApp ( getMenuItems ( ) , url ) ;
1111
1212 return (
1313 < Link to = { url } className = { styles . wrapper } >
Original file line number Diff line number Diff line change 1- import itemsMenu from 'src/utils/appsMenu' ;
1+ import getMenuItems from 'src/utils/appsMenu' ;
22
3- export type MenuItems = ReturnType < typeof itemsMenu > ;
3+ export type MenuItems = ReturnType < typeof getMenuItems > ;
44export type MenuItem = MenuItems [ 0 ] ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { Networks } from 'src/types/networks';
1414import { cybernetRoutes } from 'src/features/cybernet/ui/routes' ;
1515import { CHAIN_ID } from 'src/constants/config' ;
1616
17- const itemsMenu = ( ) => {
17+ const getMenuItems = ( ) => {
1818 const listItemMenu = [
1919 {
2020 name : 'My robot' ,
@@ -193,4 +193,4 @@ const itemsMenu = () => {
193193 return listItemMenu . filter ( ( item ) => item ) ;
194194} ;
195195
196- export default itemsMenu ;
196+ export default getMenuItems ;
You can’t perform that action at this time.
0 commit comments