Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #64 from paritytech/w3f-deploy-1.1.5
Browse files Browse the repository at this point in the history
v1.1.5
  • Loading branch information
miabarbir authored Feb 14, 2024
2 parents f9a03ab + 4406273 commit f97332d
Show file tree
Hide file tree
Showing 249 changed files with 3,535 additions and 3,725 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ podman run --d -p 8080:80 localhost/polkadot-staking-dashboard
```

<!-- markdown-link-check-disable -->

And access the **Staking Dashboard** at http://localhost:8080/.

<!-- markdown-link-check-enable-->

## Presentations
Expand Down
9 changes: 7 additions & 2 deletions check-markdown-links-config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"httpHeaders": [
{
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
"urls": [
"https://github.com/",
"https://guides.github.com/",
"https://help.github.com/",
"https://docs.github.com/"
],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
]
}
}
26 changes: 26 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## [1.1.4](https://github.com/paritytech/polkadot-staking-dashboard/compare/v1.1.3...v1.1.4) (2024-01-28)


### Features

* **ci:** add markdown-link-check ([#1865](https://github.com/paritytech/polkadot-staking-dashboard/issues/1865)) ([7e7134e](https://github.com/paritytech/polkadot-staking-dashboard/commit/7e7134ea2a42ec56d095e0809a4eaa05f94ad793))
* **fix:** account for staking rate in average reward rate ([#1886](https://github.com/paritytech/polkadot-staking-dashboard/issues/1886)) ([9938620](https://github.com/paritytech/polkadot-staking-dashboard/commit/9938620ee417bd42761a6e63828e3dd3ab8e7ee2))
* **refacor:** Pool config to bootstrap app state ([#1900](https://github.com/paritytech/polkadot-staking-dashboard/issues/1900)) ([8f51a86](https://github.com/paritytech/polkadot-staking-dashboard/commit/8f51a8672b843b7cd7172144e2157148d03325ca))
* **refactor:** Move balance syncing to static class, `activeBalances` in UI only. ([#1858](https://github.com/paritytech/polkadot-staking-dashboard/issues/1858)) ([a372487](https://github.com/paritytech/polkadot-staking-dashboard/commit/a3724879f377c38baf0e9b04e03749e0e2f65ee0))
* **refactor:** Move Polkawatch to inline instantiation ([#1890](https://github.com/paritytech/polkadot-staking-dashboard/issues/1890)) ([d7b88bd](https://github.com/paritytech/polkadot-staking-dashboard/commit/d7b88bd57701c16ad143a6e2b70897b5086f82f6))
* **refactor:** Move staking metrics `payee` to active balances ([#1904](https://github.com/paritytech/polkadot-staking-dashboard/issues/1904)) ([7b692e0](https://github.com/paritytech/polkadot-staking-dashboard/commit/7b692e06006448604929ec23fe510a7c7492141b))
* **refactor:** network metrics to static, bootstrap all state before subscribe ([#1896](https://github.com/paritytech/polkadot-staking-dashboard/issues/1896)) ([08a813c](https://github.com/paritytech/polkadot-staking-dashboard/commit/08a813c7d47d2055984f7d32c1d8b34bec9791f4))
* **refactor:** remove unneeded bonded getters ([7108e55](https://github.com/paritytech/polkadot-staking-dashboard/commit/7108e55d3f1aeeb07cdaa7cdb5608425b0d6641a))
* **refactor:** rm `ExtrinsicsProvider`, nonces to `TxMeta` ([4194150](https://github.com/paritytech/polkadot-staking-dashboard/commit/41941509cb0d930d53f3fc98a12736b0356c6846))
* **refactor:** Staking metrics to bootstrap and API ([#1905](https://github.com/paritytech/polkadot-staking-dashboard/issues/1905)) ([f6c0b93](https://github.com/paritytech/polkadot-staking-dashboard/commit/f6c0b93fc5fcaf2961c91cdeae770d5503766fe8))
* **refactor:** Subscan refactor, remove fetching from Providers ([#1878](https://github.com/paritytech/polkadot-staking-dashboard/issues/1878)) ([57e2a1b](https://github.com/paritytech/polkadot-staking-dashboard/commit/57e2a1bed952b41441635dc9eba02b79d63d3fc0))


### Bug Fixes

* balances no accounts sync ([#1889](https://github.com/paritytech/polkadot-staking-dashboard/issues/1889)) ([5316283](https://github.com/paritytech/polkadot-staking-dashboard/commit/5316283029f9a28003bb25814623f768f3294fb8))
* Render safe guards, pool useEffect fixes ([#1906](https://github.com/paritytech/polkadot-staking-dashboard/issues/1906)) ([7c0212f](https://github.com/paritytech/polkadot-staking-dashboard/commit/7c0212f428e56b2eba9c735a6299c3661dd47b25))
* roll back Substrate Connect ([#1899](https://github.com/paritytech/polkadot-staking-dashboard/issues/1899)) ([33b5671](https://github.com/paritytech/polkadot-staking-dashboard/commit/33b5671caf5ec09240e164e82618efb15deebe81))
* unlock Chunk unit type ([afe9b1c](https://github.com/paritytech/polkadot-staking-dashboard/commit/afe9b1c0256eb9840a375f1d7574895a07ba0f4a))


## [1.1.3](https://github.com/paritytech/polkadot-staking-dashboard/compare/v1.1.2...v1.1.3) (2024-01-15)


Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Going from the top-most component, the component hierarchy is set up as follows:

- `src/index.tsx`: DOM render, of little interest.
- `src/App.tsx`: wraps `<App />` in the theme provider context and determines the active network from local storage.
- `src/Providers.tsx`: imports and wraps `<Router />` with all the contexts using a withProviders hook. We also wrap styled component's theme provider context here to make the theme configuration work.
- `src/Providers.tsx`: imports and wraps `<Router />` with all the contexts using a `withProviders` hook. We also wrap styled component's theme provider context here to make the theme configuration work.
- `src/Router.tsx`: contains react router `<Route>`'s, in addition to the major app presentational components.

## Development Patterns
Expand Down
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@fortawesome/free-regular-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@ledgerhq/hw-transport-webhid": "^6.28.2",
"@ledgerhq/hw-transport-webhid": "^6.28.3",
"@polkadot-cloud/assets": "^0.3.4",
"@polkadot-cloud/core": "^1.2.4",
"@polkadot-cloud/react": "^0.3.8",
Expand All @@ -47,8 +47,9 @@
"date-fns": "^3.3.1",
"framer-motion": "^11.0.3",
"html5-qrcode": "^2.3.8",
"i18next": "^23.7.20",
"i18next": "^23.8.2",
"i18next-browser-languagedetector": "^7.2.0",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"qrcode-generator": "1.4.4",
"rc-slider": "^10.5.0",
Expand All @@ -57,24 +58,25 @@
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.12",
"react-helmet": "^6.1.0",
"react-i18next": "^14.0.1",
"react-router-dom": "^6.21.3",
"react-i18next": "^14.0.5",
"react-router-dom": "^6.22.0",
"react-scroll": "^1.9.0",
"styled-components": "^6.1.8",
"usehooks-ts": "2.10.0"
"usehooks-ts": "2.14.0"
},
"devDependencies": {
"@ledgerhq/logs": "^6.12.0",
"@types/chroma-js": "^2.4.3",
"@types/chroma-js": "^2.4.4",
"@types/lodash.debounce": "^4",
"@types/lodash.throttle": "^4.1.9",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.17",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/react-helmet": "^6.1.11",
"@types/react-scroll": "^1.8.10",
"@types/styled-components": "^5.1.34",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand All @@ -86,13 +88,13 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^3.0.0",
"gh-pages": "^6.1.1",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"sass": "^1.70.0",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vite-bundle-visualizer": "^1.0.0",
"vite-plugin-checker": "^0.6.2",
"vite": "^5.1.1",
"vite-bundle-visualizer": "^1.0.1",
"vite-plugin-checker": "^0.6.3",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.1",
Expand Down
32 changes: 11 additions & 21 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,20 @@

import type { FC } from 'react';
import { I18nextProvider } from 'react-i18next';
import { DefaultNetwork } from 'consts';
import { ThemesProvider } from 'contexts/Themes';
import { i18next } from 'locale';
import { Providers } from 'Providers';
import { NetworkProvider } from 'contexts/Network';
import { ActiveAccountsProvider } from 'contexts/ActiveAccounts';

export const App: FC = () => {
let network = localStorage.getItem('network');

if (network === null) {
network = DefaultNetwork;
localStorage.setItem('network', network);
}

return (
<I18nextProvider i18n={i18next}>
<ThemesProvider>
<NetworkProvider>
<ActiveAccountsProvider>
<Providers />
</ActiveAccountsProvider>
</NetworkProvider>
</ThemesProvider>
</I18nextProvider>
);
};
export const App: FC = () => (
<I18nextProvider i18n={i18next}>
<ThemesProvider>
<NetworkProvider>
<ActiveAccountsProvider>
<Providers />
</ActiveAccountsProvider>
</NetworkProvider>
</ThemesProvider>
</I18nextProvider>
);
26 changes: 26 additions & 0 deletions src/Page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 @paritytech/polkadot-staking-dashboard authors & contributors
// SPDX-License-Identifier: GPL-3.0-only

import { useNetwork } from 'contexts/Network';
import { Helmet } from 'react-helmet';
import type { PageItem } from 'types';
import { Page as PageWrapper } from '@polkadot-cloud/react';
import { useTranslation } from 'react-i18next';

export const Page = ({ page }: { page: PageItem }) => {
const { t } = useTranslation();
const { network } = useNetwork();
const { Entry, key } = page;

return (
<PageWrapper>
<Helmet>
<title>{`${t(key, { ns: 'base' })} : ${t('title', {
context: `${network}`,
ns: 'base',
})}`}</title>
</Helmet>
<Entry page={page} />
</PageWrapper>
);
};
26 changes: 11 additions & 15 deletions src/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ import { FiltersProvider } from 'contexts/Filters';
import { LedgerHardwareProvider } from 'contexts/Hardware/Ledger/LedgerHardware';
import { VaultAccountsProvider } from 'contexts/Hardware/Vault/VaultAccounts';
import { HelpProvider } from 'contexts/Help';
import { IdentitiesProvider } from 'contexts/Identities';
import { MenuProvider } from 'contexts/Menu';
import { MigrateProvider } from 'contexts/Migrate';
import { PromptProvider } from 'contexts/Prompt';
import { PluginsProvider } from 'contexts/Plugins';
import { ActivePoolsProvider } from 'contexts/Pools/ActivePools';
import { ActivePoolProvider } from 'contexts/Pools/ActivePool';
import { BondedPoolsProvider } from 'contexts/Pools/BondedPools';
import { PoolMembersProvider } from 'contexts/Pools/PoolMembers';
import { PoolMembershipsProvider } from 'contexts/Pools/PoolMemberships';
import { PoolsConfigProvider } from 'contexts/Pools/PoolsConfig';
import { FavoritePoolsProvider } from 'contexts/Pools/FavoritePools';
import { ProxiesProvider } from 'contexts/Proxies';
import { SetupProvider } from 'contexts/Setup';
import { StakingProvider } from 'contexts/Staking';
Expand All @@ -37,27 +35,27 @@ import { PayoutsProvider } from 'contexts/Payouts';
import { useNetwork } from 'contexts/Network';
import { APIProvider } from 'contexts/Api';
import { ThemedRouter } from 'Themes';
import type { AnyJson } from 'types';
import type { FC } from 'react';
import { withProviders } from 'library/Hooks';
import { OtherAccountsProvider } from 'contexts/Connect/OtherAccounts';
import { useActiveAccounts } from 'contexts/ActiveAccounts';
import { DappName } from 'consts';
import { ImportedAccountsProvider } from 'contexts/Connect/ImportedAccounts';
import { PoolPerformanceProvider } from 'contexts/Pools/PoolPerformance';
import { registerSaEvent } from 'Utils';
import { ExternalAccountsProvider } from 'contexts/Connect/ExternalAccounts';
import type { Provider } from 'hooks/withProviders';
import { withProviders } from 'hooks/withProviders';
import { CommunityProvider } from 'contexts/Community';

// Embed providers from hook.
export const Providers = () => {
const {
network,
networkData: { ss58 },
} = useNetwork();
const { activeAccount, setActiveAccount } = useActiveAccounts();

// !! Provider order matters
const providers: (FC<AnyJson> | [FC<AnyJson>, AnyJson])[] = [
// !! Provider order matters.
const providers: Provider[] = [
UIProvider,
[APIProvider, { network }],
VaultAccountsProvider,
LedgerHardwareProvider,
Expand Down Expand Up @@ -85,22 +83,19 @@ export const Providers = () => {
ProxiesProvider,
HelpProvider,
PluginsProvider,
IdentitiesProvider,
BondedProvider,
BalancesProvider,
StakingProvider,
PoolsConfigProvider,
FavoritePoolsProvider,
BondedPoolsProvider,
PoolMembershipsProvider,
PoolMembersProvider,
ActivePoolsProvider,
ActivePoolProvider,
TransferOptionsProvider,
ValidatorsProvider,
FavoriteValidatorsProvider,
FastUnstakeProvider,
PayoutsProvider,
PoolPerformanceProvider,
UIProvider,
SetupProvider,
MenuProvider,
TooltipProvider,
Expand All @@ -109,6 +104,7 @@ export const Providers = () => {
PromptProvider,
MigrateProvider,
FiltersProvider,
CommunityProvider,
];

return withProviders(providers, ThemedRouter);
Expand Down
Loading

0 comments on commit f97332d

Please sign in to comment.