From dc8d29b456a4a844d7a106a2c1acc46f2aff396c Mon Sep 17 00:00:00 2001 From: ealeksandrov-LimeChain <92088769+ealeksandrov-LimeChain@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:53:15 +0200 Subject: [PATCH 01/16] edit title tags and description --- README.md | 2 +- public/locales/en/common.json | 5 ++++- src/configs/chain_config.mainnet.json | 2 +- src/configs/chain_config.testnet.json | 2 +- src/screens/app/index.tsx | 4 ++-- src/screens/home/index.tsx | 29 +++++++++++++++++++-------- src/screens/transactions/index.tsx | 7 +++++-- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d6f9ce6dcd..b97699d348 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Big Dipper 2.0 ✨ (Cosmos Based Chains) -Big Dipper is an open-source block explorer and token management tool serving over 10 proof-of-stake blockchains. It has been forked more than 100 times on GitHub and has served audiences from 140 countries and regions. +The CUDOS explorer allows you to visualise blocks, network statistics & transaction history for the CUDOS network | Powering the Metaverse, NFTs, Web3, & gaming **This repo contains the UI of big dipper 2.0 only** diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 35618e1bf4..c1fdb7a35c 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -45,7 +45,10 @@ "nothingToShow": "Nothing to show", "notFound": "Not Found", "useValidatorAddress": "Please use a validator address instead", - "description": "Big Dipper is an open-source block explorer and token management tool serving over 10 proof-of-stake blockchains. It has been forked more than 100 times on GitHub and has served audiences from 140 countries and regions.", + "description": "The CUDOS explorer allows you to visualise blocks, network statistics & transaction history for the CUDOS network | Powering the Metaverse, NFTs, Web3, & gaming.", + "homeTitleDescription": "Visualise blocks, transactions & network metrics", + "transactionsTitle": "CUDOS Blockchain transactions | View & search transactions", + "transactionsDescription": "Use the CUDOS blockchain explorer to search for transactions on the network via tx hash, block height / address", "supply": "Supply", "blockTimeAgo": "Latest block displayed was {{time}}", "settings": "Settings", diff --git a/src/configs/chain_config.mainnet.json b/src/configs/chain_config.mainnet.json index 817bfd2637..c86e8f895c 100644 --- a/src/configs/chain_config.mainnet.json +++ b/src/configs/chain_config.mainnet.json @@ -1,5 +1,5 @@ { - "title": "Cudos Block Explorer", + "title": "CUDOS Blockchain explorer", "network": "cudos-1", "icon": "https://wallet.cudos.org/img/logo-icon.cb505cad.svg?sanitize=true", "logo": { diff --git a/src/configs/chain_config.testnet.json b/src/configs/chain_config.testnet.json index 341cd4753b..fe6201eb87 100644 --- a/src/configs/chain_config.testnet.json +++ b/src/configs/chain_config.testnet.json @@ -1,5 +1,5 @@ { - "title": "Cudos Block Explorer", + "title": "CUDOS Blockchain explorer", "network": "cudos-testnet-public-3", "icon": "https://wallet.cudos.org/img/logo-icon.cb505cad.svg?sanitize=true", "logo": { diff --git a/src/screens/app/index.tsx b/src/screens/app/index.tsx index 1b88869f83..9886d34877 100644 --- a/src/screens/app/index.tsx +++ b/src/screens/app/index.tsx @@ -26,11 +26,11 @@ function App(props: AppProps) { return ( <> { + const { t } = useTranslation('transactions'); const classes = useStyles(); return ( - - - - - - - - + <> + + + + + + + + + + ); }; diff --git a/src/screens/transactions/index.tsx b/src/screens/transactions/index.tsx index 814b389079..e8caaa1f71 100644 --- a/src/screens/transactions/index.tsx +++ b/src/screens/transactions/index.tsx @@ -27,9 +27,12 @@ const Transactions = () => { return ( <> Date: Wed, 16 Nov 2022 12:39:51 +0200 Subject: [PATCH 02/16] addressing-lint-errors --- .eslintignore | 1 + .eslintrc.json | 20 ++++++++++++------- src/recoil/market/hooks.ts | 2 -- .../components/communitySpend/index.tsx | 1 - .../components/votes/hooks.ts | 4 ++-- src/screens/proposal_details/utils.ts | 2 +- .../components/overview/index.tsx | 1 - .../validators/components/list/hooks.ts | 2 +- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.eslintignore b/.eslintignore index 7e639c0a8e..bb3dcdb03d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,3 +7,4 @@ **/cypress/fixtures/* **/src/graphql/types.tsx **/src/graphql/desmos_profile.ts +**/src/pages/_document.tsx diff --git a/.eslintrc.json b/.eslintrc.json index 90d6141cea..b6dd299b4e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -64,6 +64,9 @@ } ], "rules": { + "max-len": "off", + "no-console": "off", + "camelcase": "off", "react/destructuring-assignment": "off", "no-bitwise": "off", "@typescript-eslint/ban-types": "warn", @@ -73,12 +76,15 @@ "@typescript-eslint/no-var-requires": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["error", { - "ignoreRestSiblings": true, - "varsIgnorePattern": "^_", - "argsIgnorePattern": "^_" - }], - "no-param-reassign": "warn", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true, + "varsIgnorePattern": "^_", + "argsIgnorePattern": "^_" + } + ], + "no-param-reassign": "off", "no-restricted-globals": "warn", "react/prop-types": "off", "jsx-a11y/interactive-supports-focus": "off", @@ -138,4 +144,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/recoil/market/hooks.ts b/src/recoil/market/hooks.ts index 79e2ba45d2..9ec3340c76 100644 --- a/src/recoil/market/hooks.ts +++ b/src/recoil/market/hooks.ts @@ -5,7 +5,6 @@ import { useRecoilState, SetterOrUpdater, } from 'recoil'; -import Big from 'big.js'; import { useMarketDataQuery, MarketDataQuery, @@ -15,7 +14,6 @@ import { writeMarket, } from '@recoil/market'; import { AtomState } from '@recoil/market/types'; -import { getDenom } from '@utils/get_denom'; import { formatToken } from '@utils/format_token'; export const useMarketRecoil = () => { diff --git a/src/screens/proposal_details/components/overview/components/communitySpend/index.tsx b/src/screens/proposal_details/components/overview/components/communitySpend/index.tsx index f2d54deaaf..8df60b0342 100644 --- a/src/screens/proposal_details/components/overview/components/communitySpend/index.tsx +++ b/src/screens/proposal_details/components/overview/components/communitySpend/index.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import numeral from 'numeral'; import useTranslation from 'next-translate/useTranslation'; import { Table, diff --git a/src/screens/proposal_details/components/votes/hooks.ts b/src/screens/proposal_details/components/votes/hooks.ts index 7bdcb396fa..d96dc30b2d 100644 --- a/src/screens/proposal_details/components/votes/hooks.ts +++ b/src/screens/proposal_details/components/votes/hooks.ts @@ -56,11 +56,11 @@ export const useVotes = (resetPagination:any) => { const proposalVote = R.pathOr([], ['proposalVote'], votesData); - proposalVote.map((x: any) => { + proposalVote.forEach((x: any) => { x.weight = '100.00%'; }); - mergedVotesData.proposalVote.map((x: any) => { + mergedVotesData.proposalVote.forEach((x: any) => { x.weight = `${(parseFloat(x.weight) * 100.0).toFixed(2)}%`; }); diff --git a/src/screens/proposal_details/utils.ts b/src/screens/proposal_details/utils.ts index d5ece49694..5be2e5f9ac 100644 --- a/src/screens/proposal_details/utils.ts +++ b/src/screens/proposal_details/utils.ts @@ -12,7 +12,7 @@ export const getProposalType = (proposalType: string) => { type = 'communityPoolSpendProposal'; } - if (proposalType == '/ibc.core.client.v1.ClientUpdateProposal') { + if (proposalType === '/ibc.core.client.v1.ClientUpdateProposal') { type = 'IbcClientUpdateProposal'; } diff --git a/src/screens/transaction_details/components/overview/index.tsx b/src/screens/transaction_details/components/overview/index.tsx index 2faafa9df5..1cbd3b4ed2 100644 --- a/src/screens/transaction_details/components/overview/index.tsx +++ b/src/screens/transaction_details/components/overview/index.tsx @@ -11,7 +11,6 @@ import { BLOCK_DETAILS } from '@utils/go_to_page'; import { BoxDetails, Result, } from '@components'; -import { formatNumber } from '@utils/format_token'; import { useStyles } from './styles'; import { OverviewType } from '../../types'; diff --git a/src/screens/validators/components/list/hooks.ts b/src/screens/validators/components/list/hooks.ts index a77a69145e..97202bee6b 100644 --- a/src/screens/validators/components/list/hooks.ts +++ b/src/screens/validators/components/list/hooks.ts @@ -138,7 +138,7 @@ export const useValidators = () => { sorted = sorted.filter((x) => x.status === 3 && x.jailed === true); } - if (state.tab == 2) { + if (state.tab === 2) { sorted = sorted.filter((x) => x.status !== 3); } From eef6a94613fec4e15ccf8dfa45a863679d93baec Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Thu, 17 Nov 2022 07:46:03 +0200 Subject: [PATCH 03/16] fixing tests and failing github actions --- .github/workflows/docker_production.yml | 2 + .../footer/__snapshots__/index.test.tsx.snap | 109 ++++++++++++++---- .../__snapshots__/index.test.tsx.snap | 8 +- .../nav/__snapshots__/index.test.tsx.snap | 7 +- .../desktop/__snapshots__/index.test.tsx.snap | 10 +- .../__snapshots__/index.test.tsx.snap | 8 +- .../menu/__snapshots__/index.test.tsx.snap | 25 ++++ .../__snapshots__/index.test.tsx.snap | 2 +- .../nav/components/seach_bar/hooks.test.ts | 24 ++-- .../home/__snapshots__/index.test.tsx.snap | 2 +- .../desktop/__snapshots__/index.test.tsx.snap | 32 ++++- .../__snapshots__/index.test.tsx.snap | 24 ++-- .../__snapshots__/index.test.tsx.snap | 38 +----- .../tabs/__snapshots__/index.test.tsx.snap | 28 ----- .../__snapshots__/index.test.tsx.snap | 2 +- src/screens/transaction_details/hooks.ts | 6 +- .../tabs/__snapshots__/index.test.tsx.snap | 28 +++++ 17 files changed, 217 insertions(+), 138 deletions(-) diff --git a/.github/workflows/docker_production.yml b/.github/workflows/docker_production.yml index fcafdb8568..69edfb6fc5 100644 --- a/.github/workflows/docker_production.yml +++ b/.github/workflows/docker_production.yml @@ -49,6 +49,8 @@ jobs: echo ::set-output name=PORT::${PORT} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + with: + version: v0.7.0 - name: Login to DockerHub uses: docker/login-action@v1 with: diff --git a/src/components/footer/__snapshots__/index.test.tsx.snap b/src/components/footer/__snapshots__/index.test.tsx.snap index f093f48ed1..d044677889 100644 --- a/src/components/footer/__snapshots__/index.test.tsx.snap +++ b/src/components/footer/__snapshots__/index.test.tsx.snap @@ -33,7 +33,7 @@ exports[`component: layout/footer matches snapshot 1`] = ` rel="noreferrer" target="_blank" > - common:Cudos + common:cudos - common:about + common:blog - common:blog + common:about +
+
+
+ We use cookies to enhance the user experience. Read our + + + Privacy Policy + +
+
+ +
+
+

@@ -30,7 +30,7 @@ exports[`component: layout/footer matches snapshot 1`] = ` @@ -55,7 +55,7 @@ exports[`component: layout/footer matches snapshot 1`] = ` @@ -79,7 +79,7 @@ exports[`component: layout/footer matches snapshot 1`] = ` diff --git a/src/components/nav/__snapshots__/index.test.tsx.snap b/src/components/nav/__snapshots__/index.test.tsx.snap index 5c16dd8297..223d3a926b 100644 --- a/src/components/nav/__snapshots__/index.test.tsx.snap +++ b/src/components/nav/__snapshots__/index.test.tsx.snap @@ -1,8 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Component: Nav it renders 1`] = ` -
-`; +exports[`Component: Nav it renders 1`] = `null`; diff --git a/src/components/nav/components/desktop/__snapshots__/index.test.tsx.snap b/src/components/nav/components/desktop/__snapshots__/index.test.tsx.snap index b29df8a27d..e01a41d2de 100644 --- a/src/components/nav/components/desktop/__snapshots__/index.test.tsx.snap +++ b/src/components/nav/components/desktop/__snapshots__/index.test.tsx.snap @@ -3,8 +3,6 @@ exports[`screen: Nav/Desktop hook toggles correctly 1`] = `
< className="makeStyles-logo" diff --git a/src/components/nav/components/desktop/components/action_bar/__snapshots__/index.test.tsx.snap b/src/components/nav/components/desktop/components/action_bar/__snapshots__/index.test.tsx.snap index 07ade38b63..e8b3ef9503 100644 --- a/src/components/nav/components/desktop/components/action_bar/__snapshots__/index.test.tsx.snap +++ b/src/components/nav/components/desktop/components/action_bar/__snapshots__/index.test.tsx.snap @@ -31,14 +31,14 @@ exports[`screen: Nav/ActionBar displays network 1`] = `
@@ -92,14 +92,14 @@ exports[`screen: Nav/ActionBar it renders 1`] = `
diff --git a/src/components/nav/components/mobile/components/menu/__snapshots__/index.test.tsx.snap b/src/components/nav/components/mobile/components/menu/__snapshots__/index.test.tsx.snap index 199965f8a0..d1002d45fa 100644 --- a/src/components/nav/components/mobile/components/menu/__snapshots__/index.test.tsx.snap +++ b/src/components/nav/components/mobile/components/menu/__snapshots__/index.test.tsx.snap @@ -126,6 +126,31 @@ Array [ />
+
, {!!description && ( - - {description} - + )} {/* ================= */} From 9c71ab10cc54475bb4a2af48fd3c4c63a53367b5 Mon Sep 17 00:00:00 2001 From: Tugay Emin Date: Fri, 9 Dec 2022 08:51:04 +0200 Subject: [PATCH 16/16] CUDOS-1942 fix tests --- src/screens/block_details/index.test.tsx | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/screens/block_details/index.test.tsx b/src/screens/block_details/index.test.tsx index 8a061cb769..9f3d71f1a6 100644 --- a/src/screens/block_details/index.test.tsx +++ b/src/screens/block_details/index.test.tsx @@ -64,22 +64,22 @@ const mockAverageBlockTime = jest.fn().mockResolvedValue({ operatorAddress: 'desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3', }, }, - }, - ], - preCommitsAggregate: { - aggregate: { - sum: { - votingPower: 7304, - }, - }, - }, - preCommits: [ - { - validator: { - validatorInfo: { - operatorAddress: 'desmosvaloper1qlh47ty9ah2d5e0xq6gsvqjvfulljl9602k7f9', + preCommitsAggregate: { + aggregate: { + sum: { + votingPower: 7304, + }, }, }, + preCommits: [ + { + validator: { + validatorInfo: { + operatorAddress: 'desmosvaloper1qlh47ty9ah2d5e0xq6gsvqjvfulljl9602k7f9', + }, + }, + }, + ], }, ], },