Skip to content

Commit

Permalink
feat(app): fixes (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly authored Jul 27, 2024
2 parents af089f7 + 3fdafba commit 19d8607
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 30 deletions.
9 changes: 3 additions & 6 deletions src/components/TextMarkdown/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@

.markdownContainer {
margin: 0 auto;

width: clamp(320px, 100%, 580px);
min-height: 200px;

display: flex;
justify-content: center;
flex-direction: column;
Expand All @@ -51,7 +49,7 @@
margin-left: 20px;
}

@media (max-width: 680px) {
@media (width <= 680px) {
width: unset;
}
}
Expand All @@ -71,7 +69,6 @@

.markdownContainer p {
margin-bottom: 20px;
line-height: 23px;

&:last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -99,7 +96,7 @@
border: 0;

th {
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
border-bottom: 1px solid rgb(255 255 255 / 50%);
border-collapse: separate;
border-spacing: 5px 5px;
}
Expand All @@ -120,7 +117,7 @@
}

p:last-child {
margin-bottom: 0px;
margin-bottom: 0;
font-size: 16px;
}

Expand Down
9 changes: 6 additions & 3 deletions src/containers/sigma/hooks/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import BigNumber from 'bignumber.js';
import { useQuery } from '@tanstack/react-query';
import { getDelegatorDelegations } from 'src/utils/search/utils';
import { BECH32_PREFIX_VALOPER, BASE_DENOM } from 'src/constants/config';
import { fromBech32 } from '../../../utils/utils';
import { useStake as useVerseStake } from 'src/features/cybernet/ui/hooks/useCurrentAccountStake';
import { CYBERVER_CONTRACTS } from 'src/features/cybernet/constants';
import { useQueryClient } from 'src/contexts/queryClient';

import { isPussyChain } from 'src/utils/chains/pussy';
import { fromBech32 } from '../../../utils/utils';

const initValue = {
denom: BASE_DENOM,
amount: '0',
Expand Down Expand Up @@ -76,17 +78,18 @@ const getCommissionAmount = (data) => {
};

function useCyberverBalance({ address }) {
const skip = !address || !isPussyChain;
// will be refactored to loop
const s1 = useVerseStake({
address,
contractAddress: CYBERVER_CONTRACTS[0],
skip: !address,
skip,
});

const s2 = useVerseStake({
address,
contractAddress: CYBERVER_CONTRACTS[1],
skip: !address,
skip,
});

const total1 = s1.data?.reduce((acc, { stake }) => acc + stake, 0) || 0;
Expand Down
14 changes: 3 additions & 11 deletions src/features/adviser/AdviserContainer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
position: sticky;
top: 80px;
width: 60%;

z-index: 3;
z-index: 4;
min-height: 60px; // 2 lines of text

margin-top: -45px;
margin-bottom: 25px;
margin-left: auto;
margin-right: auto;

margin: -45px auto 25px;
display: flex;
justify-content: center;

@media (max-width: 540px) {
@media (width <= 540px) {
margin-top: unset;

}
}

Expand All @@ -32,7 +25,6 @@
width: 100%;
height: 110%;
left: 0;

filter: blur(12px);
}
}
4 changes: 4 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import HubProvider from './contexts/hub';

import { INDEX_HTTPS, INDEX_WEBSOCKET } from './constants/config';
import ScriptingProvider from './contexts/scripting/scripting';
import { localStorageKeys } from './constants/localStorageKeys';

const httpLink = new HttpLink({
uri: INDEX_HTTPS,
Expand Down Expand Up @@ -99,6 +100,9 @@ if (container === null) {

const root = createRoot(container);

// temp
localStorage.removeItem(localStorageKeys.settings.adviserAudio);

function Providers({ children }: { children: React.ReactNode }) {
return (
<Provider store={store}>
Expand Down
21 changes: 11 additions & 10 deletions src/layouts/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Link } from 'react-router-dom';
import CircularMenu from 'src/components/appMenu/CircularMenu/CircularMenu';
import TimeHistory from 'src/features/TimeHistory/TimeHistory';
import MobileMenu from 'src/components/appMenu/MobileMenu/MobileMenu';
import useCurrentAddress from 'src/hooks/useCurrentAddress';
import graphDataPrepared from '../pages/oracle/landing/graphDataPrepared.json';
import stylesOracle from '../pages/oracle/landing/OracleLanding.module.scss';
import SenseButton from '../features/sense/ui/SenseButton/SenseButton';
Expand All @@ -21,6 +22,8 @@ import SideHydrogenBtn from './ui/SideHydrogenBtn/SideHydrogenBtn';
function MainLayout({ children }: { children: JSX.Element }) {
const { defaultAccount } = useAppSelector(({ pocket }) => pocket);
const addressBech32 = defaultAccount.account?.cyber.bech32;

const currentAddress = useCurrentAddress();
const { viewportWidth } = useDevice();
const ref = useRef<HTMLDivElement>(null);
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -50,6 +53,10 @@ function MainLayout({ children }: { children: JSX.Element }) {
ref.current.style.setProperty('--graph-size', `${graphSize}px`);
}, [ref, graphSize]);

const link = currentAddress
? routes.robot.routes.brain.path
: routes.brain.path;

return (
<div className={styles.wrapper} ref={ref}>
<Header />
Expand All @@ -62,16 +69,13 @@ function MainLayout({ children }: { children: JSX.Element }) {
{isMobile ? <MobileMenu /> : <CircularMenu circleSize={graphSize} />}
{!isMobile && (
<Link
to={routes.brain.path}
to={link}
className={stylesOracle.graphWrapper}
style={{ bottom: '0px' }}
>
{/* <Link
to={routes.brain.path}
className={stylesOracle.enlargeBtn}
title="open full graph"
/> */}

// className={stylesOracle.enlargeBtn}
// title="open full graph"
>
{isRenderGraph && (
<CyberlinksGraphContainer
size={graphSize}
Expand All @@ -80,13 +84,10 @@ function MainLayout({ children }: { children: JSX.Element }) {
)}
</Link>
)}
{/* <ActionBar /> */}

<div className={styles.Time}>
{!isMobile && <TimeHistory />}
<TimeFooter />
</div>
{/* <Link to={routes.social.path}>contacts</Link> */}
</footer>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const routes = {
energy: {
path: '/robot/energy',
},
brain: {
path: '/robot/brain',
},
},
},
robotPassport: {
Expand Down
4 changes: 4 additions & 0 deletions src/utils/chains/pussy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { CHAIN_ID } from 'src/constants/config';
import { Networks } from 'src/types/networks';

export const isPussyChain = CHAIN_ID === Networks.SPACE_PUSSY;

0 comments on commit 19d8607

Please sign in to comment.