Skip to content

Commit

Permalink
fix(app): fixes/improvements (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly authored Sep 4, 2024
1 parent 0de8286 commit 9cef866
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 240 deletions.
13 changes: 4 additions & 9 deletions src/components/containerGradient/Display/Display.module.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@import '../saber/index.module.scss';
@import './variables.module.scss';
@import '../../../style/mixins.scss';
@import '../saber/index.module';
@import './variables.module';
@import '../../../style/mixins';

.wrapper {
// TODO: remove this
z-index: 0;

display: flex;
flex-direction: column;

Expand Down Expand Up @@ -46,13 +45,9 @@
.inner {
padding: $display-padding-top $display-padding-x;
overflow: auto;

height: 100%;
max-height: 100%;

// unclear gap, because of overflow:auto
margin-top: -0.5px;

@include blueScroll;
}

Expand All @@ -71,4 +66,4 @@
}

@include blueScroll;
}
}
4 changes: 2 additions & 2 deletions src/components/ledger/stageActionBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export function TransactionSubmitted() {

export function Confirmed({ txHash, txHeight, cosmos, onClickBtnClose }) {
return (
<ActionBar button={{ text: ' Fuck Google', onClick: onClickBtnClose }}>
<ActionBar button={{ text: 'Fuck Google', onClick: onClickBtnClose }}>
<span>
Transaction
Transaction successful:{' '}
{cosmos ? (
<LinkWindow to={`https://www.mintscan.io/txs/${txHash}`}>
{trimString(txHash, 6, 6)}
Expand Down
4 changes: 2 additions & 2 deletions src/containers/mint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
FormatNumberTokens,
} from 'src/components';
import { formatNumber, getDisplayAmount } from 'src/utils/utils';
import { DENOM_LIQUID } from 'src/constants/config';
import useGetSlots from './useGetSlots';
import { TableSlots } from '../energy/ui';
import ActionBar from './actionBar';
Expand All @@ -32,7 +33,6 @@ import RcSlider from './components/Slider/Slider';
import InfoText from './InfoText/InfoText';
import LiquidBalances from './LiquidBalances/LiquidBalances';
import ERatio from './components/ERatio/ERatio';
import { DENOM_LIQUID } from 'src/constants/config';

const returnColorDot = (marks) => {
return {
Expand Down Expand Up @@ -228,7 +228,7 @@ function Mint() {
{loadingAuthAccounts ? (
<Dots big />
) : (
<Display noPaddingX>
<Display noPadding>
<TableSlots data={slotsData} />
</Display>
)}
Expand Down
31 changes: 18 additions & 13 deletions src/hocs/withIpfsAndKeplr.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import React from 'react';
import { useBackend } from 'src/contexts/backend/backend';
import { useQueryClient } from 'src/contexts/queryClient';
import { useSigningClient } from 'src/contexts/signerClient';

const withIpfsAndKeplr = (Component) => (props) => {
const { ipfsApi, senseApi } = useBackend();
const { signer, signingClient } = useSigningClient();
const withIpfsAndKeplr = (Component: React.ComponentType) =>
function WithIpfsAndKeplr(props: any) {
const { ipfsApi, senseApi } = useBackend();
const { signer, signingClient } = useSigningClient();
const queryClient = useQueryClient();

return (
<Component
{...props}
ipfsApi={ipfsApi}
signer={signer}
signingClient={signingClient}
senseApi={senseApi}
/>
);
};
return (
<Component
{...props}
ipfsApi={ipfsApi}
signer={signer}
signingClient={signingClient}
senseApi={senseApi}
queryClient={queryClient}
/>
);
};

export default withIpfsAndKeplr;
2 changes: 1 addition & 1 deletion src/pages/Social/Discord/Discord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import discordIcon from './discord-icon.svg';

function Discord() {
return (
<LinkWindow to="https://discord.com/invite/ARwv74ZyGH">
<LinkWindow to="https://discord.gg/cyber-bostrom-spacepussy">
<img src={discordIcon} alt="Discord" />
<span>Discord</span>
</LinkWindow>
Expand Down
13 changes: 5 additions & 8 deletions src/pages/Social/Social.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import { LinkWindow, MainContainer } from 'src/components';
import Discord from 'src/pages/Social/Discord/Discord';
import { GitHub } from 'src/pages/Social/GitHub/GitHub';
import { Telegram } from 'src/pages/Social/Telegram/Telegram';
import Telegram from 'src/pages/Social/Telegram/Telegram';
import Display from 'src/components/containerGradient/Display/Display';
import DisplayTitle from 'src/components/containerGradient/DisplayTitle/DisplayTitle';
import { useAdviser } from 'src/features/adviser/context';
import { useEffect } from 'react';
import useAdviserTexts from 'src/features/adviser/useAdviserTexts';
import Twitter from './Twitter/Twitter';
import styles from './Social.module.scss';

export const HUB_LINK = 'https://docs.cyb.ai/#/page/aicosystem';

// TODO: folder is dirty, can be refactored
function Social() {
const { setAdviser } = useAdviser();

useEffect(() => {
setAdviser('join our community!');
}, [setAdviser]);
useAdviserTexts({
defaultText: 'join our community 🤖',
});

return (
<MainContainer>
Expand Down
138 changes: 17 additions & 121 deletions src/pages/Social/Telegram/Telegram.tsx
Original file line number Diff line number Diff line change
@@ -1,133 +1,29 @@
import Tooltip from '../../../components/tooltip/tooltip';
import share from '../../../image/share.svg';
import telegram from './telegram-icon.svg';
import { LinkWindow } from '../../../components/link/link';
import useMediaQuery from '../../../hooks/useMediaQuery';
import React from 'react';
import styles from './Telegram.module.scss';

export function Telegram() {
// const mediaQuery = useMediaQuery('(min-width: 768px)');

if (true) {
return (
<div
// id="github-bar"
className={styles.wrapper}
style={{
display: 'flex',
// position: 'fixed',
// left: '0',
// bottom: 0,
// margin: '0px 0px 28px 20px',
// fontSize: '14px',
// background: '#000c',
// zIndex: 4,
// marginLeft: 15,
}}
>
<LinkWindow to="https://t.me/cyber">
<img
alt="telegram"
style={{ width: 30, height: 30 }}
src={telegram}
/>

<span>t/eng</span>
</LinkWindow>
function Telegram() {
return (
<div className={styles.wrapper}>
<LinkWindow to="https://t.me/CyberGlobalHub">
<img alt="telegram" style={{ width: 30, height: 30 }} src={telegram} />

<LinkWindow to="https://t.me/CyberGlobalHub">
<img
alt="telegram"
style={{ width: 30, height: 30 }}
src={telegram}
/>
<span>t/eng</span>
</LinkWindow>

<span>t/ru</span>
</LinkWindow>
<LinkWindow to="https://t.me/bostrom_news">
<img alt="telegram" style={{ width: 30, height: 30 }} src={telegram} />

<LinkWindow to="https://t.me/bostrom_news">
<img
alt="telegram"
style={{ width: 30, height: 30 }}
src={telegram}
/>
<span>t/news</span>
</LinkWindow>

<span>t/news</span>
</LinkWindow>
</div>
);
}
<LinkWindow to="https://t.me/fameofcyber">
<img alt="telegram" style={{ width: 30, height: 30 }} src={telegram} />

return (
// <div
// id="github-bar"
// style={{
// // position: 'fixed',
// left: '0',
// bottom: 0,
// margin: '0px 0px 28px 20px',
// fontSize: '14px',
// background: '#000c',
// zIndex: 4,
// marginLeft: 15,
// }}
// >
<Tooltip
hideBorder
placement="right"
tooltip={
<div
style={
{
// display: 'flex',
// alignItems: 'center',
// fontSize: '14px',
// gap: '20px',
// background: '#000c',
// padding: 5,
}
}
>
<LinkWindow to="https://t.me/cyber/47885">
<div
style={{
display: 'flex',
alignItems: 'center',
color: '#36D6AE',
whiteSpace: 'nowrap',
}}
>
feedback{' '}
<img alt="share" style={{ width: 20, height: 20 }} src={share} />
</div>
</LinkWindow>
<LinkWindow to="https://t.me/cyber/47896">
<div
style={{
display: 'flex',
alignItems: 'center',
color: '#36D6AE',
whiteSpace: 'nowrap',
}}
>
join movement{' '}
<img alt="share" style={{ width: 20, height: 20 }} src={share} />
</div>
</LinkWindow>
</div>
}
>
<LinkWindow to="https://t.me/cyber">
<div>
<img
alt="telegram"
style={{ width: 30, height: 30 }}
src={telegram}
/>
</div>
<span>t/validators</span>
</LinkWindow>
</Tooltip>
// {/* </div> */}
</div>
);
}

export default Telegram;
2 changes: 1 addition & 1 deletion src/pages/Social/Twitter/Twitter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Twitter() {
return (
<LinkWindow to="https://twitter.com/cyber_devs">
<img src={twitterIcon} alt="Twitter" />
<span>twitter</span>
<span>x (twitter)</span>
</LinkWindow>
);
}
Expand Down
42 changes: 8 additions & 34 deletions src/pages/oracle/landing/OracleLanding.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { ActionBar, Button, Tabs } from 'src/components';
import { routes } from 'src/routes';
import { useRef, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
// import CyberlinksGraphContainer from 'src/features/cyberlinks/CyberlinksGraph/CyberlinksGraphContainer';
import { Stars } from 'src/containers/portal/components';

import { useDevice } from 'src/contexts/device';

import { useAppDispatch } from 'src/redux/hooks';
import { setFocus } from 'src/containers/application/Header/Commander/commander.redux';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';

import { Link, useSearchParams } from 'react-router-dom';
import useAdviserTexts from 'src/features/adviser/useAdviserTexts';
import styles from './OracleLanding.module.scss';
import KeywordButton from './components/KeywordButton/KeywordButton';
Expand All @@ -33,9 +32,8 @@ const listConfig = {
),
description: (
<>
decentralized search is just one{' '}
<Link to={routes.oracle.ask.getLink('cyber')}>cyber</Link> <i>app</i>{' '}
aip
decentralized <Link to={routes.oracle.ask.getLink('ipfs')}>ipfs</Link>{' '}
search
</>
),
},
Expand Down Expand Up @@ -77,40 +75,16 @@ function OracleLanding() {

const [titleType, setTitleType] = useState<TitleType>(TitleType.ai);

const [isRenderGraph, setIsRenderGraph] = useState(false);

const { viewportWidth } = useDevice();
const navigate = useNavigate();

const ref = useRef<HTMLDivElement>(null);
const dispatch = useAppDispatch();

const graphSize = 220;
const isMobile =
viewportWidth <= Number(styles.mobileBreakpoint.replace('px', ''));

useAdviserTexts({
defaultText: 'ask your question',
});
// useEffect(() => {
// dispatch(setFocus(true));

// const timeout = setTimeout(() => {
// setIsRenderGraph(true);
// }, 1000 * 1.5);

// return () => {
// clearTimeout(timeout);
// };
// }, [dispatch]);

// useEffect(() => {
// if (!ref.current) {
// return;
// }

// ref.current.style.setProperty('--graph-size', `${graphSize}px`);
// }, [ref, graphSize]);
useEffect(() => {
dispatch(setFocus(true));
}, [dispatch]);

const { title, description, text } = listConfig[titleType];

Expand Down
Loading

0 comments on commit 9cef866

Please sign in to comment.