Skip to content

Commit f4c62c3

Browse files
committed
change brain link
1 parent 6604557 commit f4c62c3

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/layouts/Main.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Link } from 'react-router-dom';
1212
import CircularMenu from 'src/components/appMenu/CircularMenu/CircularMenu';
1313
import TimeHistory from 'src/features/TimeHistory/TimeHistory';
1414
import MobileMenu from 'src/components/appMenu/MobileMenu/MobileMenu';
15+
import useCurrentAddress from 'src/hooks/useCurrentAddress';
1516
import graphDataPrepared from '../pages/oracle/landing/graphDataPrepared.json';
1617
import stylesOracle from '../pages/oracle/landing/OracleLanding.module.scss';
1718
import SenseButton from '../features/sense/ui/SenseButton/SenseButton';
@@ -21,6 +22,8 @@ import SideHydrogenBtn from './ui/SideHydrogenBtn/SideHydrogenBtn';
2122
function MainLayout({ children }: { children: JSX.Element }) {
2223
const { defaultAccount } = useAppSelector(({ pocket }) => pocket);
2324
const addressBech32 = defaultAccount.account?.cyber.bech32;
25+
26+
const currentAddress = useCurrentAddress();
2427
const { viewportWidth } = useDevice();
2528
const ref = useRef<HTMLDivElement>(null);
2629
const dispatch = useAppDispatch();
@@ -50,6 +53,10 @@ function MainLayout({ children }: { children: JSX.Element }) {
5053
ref.current.style.setProperty('--graph-size', `${graphSize}px`);
5154
}, [ref, graphSize]);
5255

56+
const link = currentAddress
57+
? routes.robot.routes.brain.path
58+
: routes.brain.path;
59+
5360
return (
5461
<div className={styles.wrapper} ref={ref}>
5562
<Header />
@@ -62,16 +69,13 @@ function MainLayout({ children }: { children: JSX.Element }) {
6269
{isMobile ? <MobileMenu /> : <CircularMenu circleSize={graphSize} />}
6370
{!isMobile && (
6471
<Link
65-
to={routes.brain.path}
72+
to={link}
6673
className={stylesOracle.graphWrapper}
6774
style={{ bottom: '0px' }}
68-
>
69-
{/* <Link
70-
to={routes.brain.path}
71-
className={stylesOracle.enlargeBtn}
72-
title="open full graph"
73-
/> */}
7475

76+
// className={stylesOracle.enlargeBtn}
77+
// title="open full graph"
78+
>
7579
{isRenderGraph && (
7680
<CyberlinksGraphContainer
7781
size={graphSize}
@@ -80,13 +84,10 @@ function MainLayout({ children }: { children: JSX.Element }) {
8084
)}
8185
</Link>
8286
)}
83-
{/* <ActionBar /> */}
84-
8587
<div className={styles.Time}>
8688
{!isMobile && <TimeHistory />}
8789
<TimeFooter />
8890
</div>
89-
{/* <Link to={routes.social.path}>contacts</Link> */}
9091
</footer>
9192
</div>
9293
);

src/routes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export const routes = {
4545
energy: {
4646
path: '/robot/energy',
4747
},
48+
brain: {
49+
path: '/robot/brain',
50+
},
4851
},
4952
},
5053
robotPassport: {

0 commit comments

Comments
 (0)