Skip to content

Commit 19d8607

Browse files
authored
feat(app): fixes (#1209)
2 parents af089f7 + 3fdafba commit 19d8607

File tree

7 files changed

+34
-30
lines changed

7 files changed

+34
-30
lines changed

src/components/TextMarkdown/styles.module.scss

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828

2929
.markdownContainer {
3030
margin: 0 auto;
31-
3231
width: clamp(320px, 100%, 580px);
3332
min-height: 200px;
34-
3533
display: flex;
3634
justify-content: center;
3735
flex-direction: column;
@@ -51,7 +49,7 @@
5149
margin-left: 20px;
5250
}
5351

54-
@media (max-width: 680px) {
52+
@media (width <= 680px) {
5553
width: unset;
5654
}
5755
}
@@ -71,7 +69,6 @@
7169

7270
.markdownContainer p {
7371
margin-bottom: 20px;
74-
line-height: 23px;
7572

7673
&:last-child {
7774
margin-bottom: 0;
@@ -99,7 +96,7 @@
9996
border: 0;
10097

10198
th {
102-
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
99+
border-bottom: 1px solid rgb(255 255 255 / 50%);
103100
border-collapse: separate;
104101
border-spacing: 5px 5px;
105102
}
@@ -120,7 +117,7 @@
120117
}
121118

122119
p:last-child {
123-
margin-bottom: 0px;
120+
margin-bottom: 0;
124121
font-size: 16px;
125122
}
126123

src/containers/sigma/hooks/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import BigNumber from 'bignumber.js';
44
import { useQuery } from '@tanstack/react-query';
55
import { getDelegatorDelegations } from 'src/utils/search/utils';
66
import { BECH32_PREFIX_VALOPER, BASE_DENOM } from 'src/constants/config';
7-
import { fromBech32 } from '../../../utils/utils';
87
import { useStake as useVerseStake } from 'src/features/cybernet/ui/hooks/useCurrentAccountStake';
98
import { CYBERVER_CONTRACTS } from 'src/features/cybernet/constants';
109
import { useQueryClient } from 'src/contexts/queryClient';
1110

11+
import { isPussyChain } from 'src/utils/chains/pussy';
12+
import { fromBech32 } from '../../../utils/utils';
13+
1214
const initValue = {
1315
denom: BASE_DENOM,
1416
amount: '0',
@@ -76,17 +78,18 @@ const getCommissionAmount = (data) => {
7678
};
7779

7880
function useCyberverBalance({ address }) {
81+
const skip = !address || !isPussyChain;
7982
// will be refactored to loop
8083
const s1 = useVerseStake({
8184
address,
8285
contractAddress: CYBERVER_CONTRACTS[0],
83-
skip: !address,
86+
skip,
8487
});
8588

8689
const s2 = useVerseStake({
8790
address,
8891
contractAddress: CYBERVER_CONTRACTS[1],
89-
skip: !address,
92+
skip,
9093
});
9194

9295
const total1 = s1.data?.reduce((acc, { stake }) => acc + stake, 0) || 0;

src/features/adviser/AdviserContainer.module.scss

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
position: sticky;
33
top: 80px;
44
width: 60%;
5-
6-
z-index: 3;
5+
z-index: 4;
76
min-height: 60px; // 2 lines of text
8-
9-
margin-top: -45px;
10-
margin-bottom: 25px;
11-
margin-left: auto;
12-
margin-right: auto;
13-
7+
margin: -45px auto 25px;
148
display: flex;
159
justify-content: center;
1610

17-
@media (max-width: 540px) {
11+
@media (width <= 540px) {
1812
margin-top: unset;
19-
2013
}
2114
}
2215

@@ -32,7 +25,6 @@
3225
width: 100%;
3326
height: 110%;
3427
left: 0;
35-
3628
filter: blur(12px);
3729
}
3830
}

src/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import HubProvider from './contexts/hub';
4646

4747
import { INDEX_HTTPS, INDEX_WEBSOCKET } from './constants/config';
4848
import ScriptingProvider from './contexts/scripting/scripting';
49+
import { localStorageKeys } from './constants/localStorageKeys';
4950

5051
const httpLink = new HttpLink({
5152
uri: INDEX_HTTPS,
@@ -99,6 +100,9 @@ if (container === null) {
99100

100101
const root = createRoot(container);
101102

103+
// temp
104+
localStorage.removeItem(localStorageKeys.settings.adviserAudio);
105+
102106
function Providers({ children }: { children: React.ReactNode }) {
103107
return (
104108
<Provider store={store}>

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: {

src/utils/chains/pussy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { CHAIN_ID } from 'src/constants/config';
2+
import { Networks } from 'src/types/networks';
3+
4+
export const isPussyChain = CHAIN_ID === Networks.SPACE_PUSSY;

0 commit comments

Comments
 (0)