Skip to content

Commit e62a62b

Browse files
Refactoring/zerg rush (#1140)
Co-authored-by: dimakorzhovnik <[email protected]>
1 parent e78e65f commit e62a62b

File tree

394 files changed

+16600
-10280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

394 files changed

+16600
-10280
lines changed

codegen.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { CodegenConfig } from '@graphql-codegen/cli';
2+
3+
const schemaUrl = 'https://index.bostrom.cybernode.ai/v1/graphql'; //process.env.NEXT_PUBLIC_GRAPHQL_HOST;
4+
5+
const config: CodegenConfig = {
6+
overwrite: true,
7+
schema: schemaUrl,
8+
documents: ['src/**/*.graphql'],
9+
config: {
10+
withHooks: true,
11+
skipTypename: true,
12+
},
13+
generates: {
14+
'src/generated/graphql.ts': {
15+
plugins: [
16+
'typescript',
17+
'typescript-operations',
18+
'typescript-react-apollo',
19+
],
20+
},
21+
},
22+
};
23+
24+
export default config;

docker-compose.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ services:
99
environment:
1010
- NODE_OPTIONS=--max-old-space-size=8192
1111
- CHAIN_ID=bostrom
12-
- CYBER_NODE_URL_API=https://rpc.bostrom.cybernode.ai
13-
- CYBER_NODE_URL_WS=wss://rpc.bostrom.cybernode.ai/websocket
14-
- CYBER_NODE_URL_LCD=https://lcd.bostrom.cybernode.ai
15-
- CYBER_INDEX_HTTPS=https://index.bostrom.cybernode.ai/v1/graphql
16-
- CYBER_INDEX_WEBSOCKET=wss://index.bostrom.cybernode.ai/v1/graphql
12+
- RPC_URL=https://rpc.bostrom.cybernode.ai
13+
- LCD_URL=https://lcd.bostrom.cybernode.ai
14+
- WEBSOCKET_URL=wss://rpc.bostrom.cybernode.ai/websocket
15+
- INDEX_HTTPS=https://index.bostrom.cybernode.ai/v1/graphql
16+
- INDEX_WEBSOCKET=wss://index.bostrom.cybernode.ai/v1/graphql
1717
- CYBER_GATEWAY=https://gateway.bostrom.cybernode.ai
18+
- BASE_DENOM=boot
19+
- DENOM_LIQUID=hydrogen
20+
- BECH32_PREFIX=bostrom
21+
1822
command: npx serve -s build

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121
"stylelint:lint": "stylelint \"**/*.*css\"",
2222
"storybook": "storybook dev -p 6006",
2323
"build-storybook": "storybook build",
24-
"test": "jest --transformIgnorePatterns --verbose"
24+
"test": "jest --transformIgnorePatterns --verbose",
25+
"generate-graphql-types": "yarn graphql-codegen --config ./codegen.ts"
2526
},
2627
"browserslist": "> 0.5%, last 2 versions, not dead",
2728
"license": "ISC",
2829
"devDependencies": {
29-
"@babel/core": "7.21.0",
30+
"@babel/core": "^7.24.3",
3031
"@babel/eslint-parser": "^7.16.5",
3132
"@babel/helper-compilation-targets": "^7.21.4",
3233
"@babel/plugin-proposal-class-properties": "7.18.6",
@@ -36,6 +37,10 @@
3637
"@babel/preset-typescript": "^7.21.0",
3738
"@commitlint/cli": "^11.0.0",
3839
"@commitlint/config-conventional": "^11.0.0",
40+
"@graphql-codegen/cli": "^5.0.2",
41+
"@graphql-codegen/typescript": "^4.0.6",
42+
"@graphql-codegen/typescript-operations": "^4.2.0",
43+
"@graphql-codegen/typescript-react-apollo": "^4.3.0",
3944
"@keplr-wallet/types": "^0.11.52",
4045
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
4146
"@rjsf/core": "^3.2.1",
@@ -82,6 +87,7 @@
8287
"eslint-plugin-react": "^7.32.2",
8388
"eslint-plugin-typescript": "^0.14.0",
8489
"file-loader": "^6.2.0",
90+
"graphql-tag": "^2.12.6",
8591
"history": "^4.9.0",
8692
"html-webpack-plugin": "^5.5.0",
8793
"https-browserify": "^1.0.0",
@@ -139,14 +145,15 @@
139145
"@chainsafe/libp2p-noise": "^13.0.1",
140146
"@chainsafe/libp2p-yamux": "^5.0.0",
141147
"@confio/relayer": "0.4.0",
148+
"@cosmjs/cosmwasm-stargate": "^0.30.0",
142149
"@cosmjs/crypto": "0.29.0",
143150
"@cosmjs/encoding": "0.29.0",
144151
"@cosmjs/launchpad": "^0.27.1",
145152
"@cosmjs/math": "^0.29.0",
146153
"@cosmjs/proto-signing": "0.29.0",
147154
"@cosmjs/stargate": "0.32.0",
148155
"@cosmjs/tendermint-rpc": "0.29.0",
149-
"@cybercongress/cyber-js": "0.3.6",
156+
"@cybercongress/cyber-js": "^0.3.9",
150157
"@cybercongress/gravity": "0.0.15",
151158
"@ethersproject/providers": "^5.7.2",
152159
"@helia/unixfs": "^1.4.2",

src/components/AmountDenom/AmountDenom.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ type Props = {
1010
};
1111

1212
function AmountDenom({ amountValue, denom, styleValue }: Props) {
13-
const { traseDenom } = useIbcDenom();
13+
const { tracesDenom } = useIbcDenom();
1414

1515
let amount = 0;
1616

1717
if (amountValue && amountValue > 0) {
18-
const [{ coinDecimals }] = traseDenom(denom);
18+
const [{ coinDecimals }] = tracesDenom(denom);
1919
amount = convertAmount(amountValue, coinDecimals);
2020
}
2121

src/components/BandwidthBar/index.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ import { Battery, Pane, Text } from '@cybercongress/gravity';
33
import { Link } from 'react-router-dom';
44
import { useDispatch, useSelector } from 'react-redux';
55
import { useQueryClient } from 'src/contexts/queryClient';
6+
import { Networks } from 'src/types/networks';
7+
import { routes } from 'src/routes';
8+
import { CHAIN_ID, BASE_DENOM } from 'src/constants/config';
69
import Tooltip from '../tooltip/tooltip';
7-
import { CYBER } from '../../utils/config';
810
import {
911
coinDecimals,
1012
convertResources,
1113
formatCurrency,
1214
reduceBalances,
1315
} from '../../utils/utils';
1416
import { setBandwidth } from '../../redux/actions/bandwidth';
15-
import { useSigningClient } from 'src/contexts/signerClient';
16-
import { Networks } from 'src/types/networks';
17-
import { routes } from 'src/routes';
1817

1918
const PREFIXES = [
2019
{
@@ -55,26 +54,26 @@ function ContentTooltip({ bwRemained, bwMaxValue, amounPower, countLink }) {
5554
{text}
5655
<Link
5756
to={
58-
CYBER.CHAIN_ID === Networks.BOSTROM
57+
CHAIN_ID === Networks.BOSTROM
5958
? routes.search.getLink('get BOOT')
6059
: routes.teleport.path
6160
}
6261
>
63-
Get {CYBER.DENOM_CYBER.toUpperCase()}
62+
Get {BASE_DENOM.toUpperCase()}
6463
</Link>
6564
</Text>
6665
</Pane>
6766
</Pane>
6867
);
6968
}
7069

71-
function BandwidthBar({ tooltipPlacement }) // bwRemained = 0,
72-
// bwMaxValue = 0,
73-
// countLink = 0,
74-
// amounPower,
75-
// ...props
70+
function BandwidthBar({ tooltipPlacement }) {
71+
// bwRemained = 0,
72+
// bwMaxValue = 0,
73+
// countLink = 0,
74+
// amounPower,
75+
// ...props
7676

77-
{
7877
const [linkPrice] = useState(4);
7978

8079
const queryClient = useQueryClient();

src/components/ContentItem/contentItem.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import React, { useEffect, useState } from 'react';
33
import { Link } from 'react-router-dom';
44
import { $TsFixMe } from 'src/types/tsfix';
55
import useQueueIpfsContent from 'src/hooks/useQueueIpfsContent';
6-
import { IpfsContentType } from 'src/utils/ipfs/ipfs';
7-
import { IPFSContentDetails } from 'src/services/ipfs/ipfs';
6+
import type {
7+
IpfsContentType,
8+
IPFSContentDetails,
9+
} from 'src/services/ipfs/types';
10+
import { LinksType } from 'src/containers/Search/types';
11+
812
import { parseArrayLikeToDetails } from 'src/services/ipfs/utils/content';
913

1014
import SearchItem from '../SearchItem/searchItem';
@@ -18,6 +22,7 @@ type ContentItemProps = {
1822
grade?: $TsFixMe;
1923
className?: string;
2024
parent?: string;
25+
linkType: LinksType;
2126
setType?: (type: IpfsContentType) => void;
2227
};
2328

src/components/MusicalAddress/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable no-restricted-syntax */
22
import * as Tone from 'tone';
33
import {
4+
PATTERN_CYBER,
45
PATTERN_ETH,
56
PATTERN_COSMOS,
67
PATTERN_OSMOS,
78
PATTERN_TERRA,
89
PATTERN_CYBER_VALOPER,
9-
} from '../../utils/config';
10-
import { PATTERN_CYBER } from 'src/constants/app';
10+
} from 'src/constants/patterns';
1111

1212
const DICTIONARY_ABC = {
1313
a: { note: 'E3', height: 16, gain: 1, color: '#36D6AE' },

src/components/Row/Row.module.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.container {
2+
display: grid;
3+
grid-template-columns: 240px 1fr;
4+
align-items: center;
5+
line-height: 20px;
6+
font-size: 16px;
7+
8+
.value {
9+
text-transform: none !important;
10+
display: flex;
11+
align-items: center;
12+
justify-content: flex-start;
13+
}
14+
}
15+
16+
17+
18+
.rowsContainer {
19+
display: grid;
20+
gap: 10px;
21+
}

src/components/Row/Row.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { ReactNode } from 'react';
2+
import styles from './Row.module.scss';
3+
4+
function Row({ value, title }: { title: ReactNode; value: ReactNode }) {
5+
return (
6+
<div className={styles.container}>
7+
<span className={styles.key}>{title}:</span>
8+
<span className={styles.value}>{value}</span>
9+
</div>
10+
);
11+
}
12+
13+
export function RowsContainer({ children }: { children: ReactNode }) {
14+
return <div className={styles.rowsContainer}>{children}</div>;
15+
}
16+
17+
export default Row;

src/components/SearchItem/searchItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import styles from './styles.module.scss';
22
import Status, { StatusType } from './status';
33
import Display from '../containerGradient/Display/Display';
4+
import { LinksType } from 'src/containers/Search/types';
45

56
const gradeColorRank = (grade) => {
67
let classColor = 'grey';
@@ -34,6 +35,7 @@ type Props = {
3435
grade?: {
3536
value: number;
3637
};
38+
linkType: LinksType;
3739
children: React.ReactNode;
3840
};
3941

0 commit comments

Comments
 (0)