From faf90dc4a0c09095b363fb1b0f421a10623cdb71 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Wed, 1 May 2024 18:31:37 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Hotfix:=20Fix=20nominate=20links?= =?UTF-8?q?=20(#4846)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix nominator links * Bum version to `3.5.2` --- CHANGELOG.md | 8 +++++++- packages/ui/.env.example | 2 ++ packages/ui/package.json | 2 +- packages/ui/src/common/hooks/usePolkadotAppLink.ts | 8 ++++++++ .../NominatingRedirectModal/NominatingRedirectModal.tsx | 9 ++++----- 5 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 packages/ui/src/common/hooks/usePolkadotAppLink.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index a007d1be5d..e858d0a9ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.5.2] - 2024-05-01 + +### Fixed +- Fix nominate links. + ## [3.5.1] - 2024-04-25 ### Fixed @@ -384,7 +389,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1.1] - 2022-12-02 -[unreleased]: https://github.com/Joystream/pioneer/compare/v3.5.1...HEAD +[unreleased]: https://github.com/Joystream/pioneer/compare/v3.5.2...HEAD +[3.5.1]: https://github.com/Joystream/pioneer/compare/v3.5.1...v3.5.2 [3.5.1]: https://github.com/Joystream/pioneer/compare/v3.5.0...v3.5.1 [3.5.0]: https://github.com/Joystream/pioneer/compare/v3.4.0...v3.5.0 [3.4.0]: https://github.com/Joystream/pioneer/compare/v3.3.1...v3.4.0 diff --git a/packages/ui/.env.example b/packages/ui/.env.example index 9820d7481e..209afd5b88 100644 --- a/packages/ui/.env.example +++ b/packages/ui/.env.example @@ -12,6 +12,8 @@ REACT_APP_MAINNET_QUERY_NODE_SOCKET=wss://query.joystream.org/graphql REACT_APP_MAINNET_MEMBERSHIP_FAUCET_URL=https://faucet.joystream.org/member-faucet/register REACT_APP_MAINNET_BACKEND=https://api-7zai.onrender.com +REACT_APP_POLKADOT_APP=https://polkadot.js.org/apps + # Faucet CAPTCHA REACT_APP_CAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001 diff --git a/packages/ui/package.json b/packages/ui/package.json index 2b4d79a87d..f290e3d33a 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@joystream/pioneer", - "version": "3.5.1", + "version": "3.5.2", "license": "GPL-3.0-only", "scripts": { "build": "node --max_old_space_size=4096 ./build.js", diff --git a/packages/ui/src/common/hooks/usePolkadotAppLink.ts b/packages/ui/src/common/hooks/usePolkadotAppLink.ts new file mode 100644 index 0000000000..d3770500ad --- /dev/null +++ b/packages/ui/src/common/hooks/usePolkadotAppLink.ts @@ -0,0 +1,8 @@ +import { useNetworkEndpoints } from './useNetworkEndpoints' + +export const usePolkadotAppLink = ( + polkadotApp = process.env.REACT_APP_POLKADOT_APP ?? 'https://polkadot.js.org/apps' +): string => { + const [endpoints] = useNetworkEndpoints() + return `${polkadotApp}?rpc=${endpoints.nodeRpcEndpoint}#` +} diff --git a/packages/ui/src/validators/modals/NominatingRedirectModal/NominatingRedirectModal.tsx b/packages/ui/src/validators/modals/NominatingRedirectModal/NominatingRedirectModal.tsx index 835ca1e394..2ae5d4410b 100644 --- a/packages/ui/src/validators/modals/NominatingRedirectModal/NominatingRedirectModal.tsx +++ b/packages/ui/src/validators/modals/NominatingRedirectModal/NominatingRedirectModal.tsx @@ -6,11 +6,13 @@ import { Link } from '@/common/components/Link' import { Modal, ModalBody, ModalFooter, ModalHeader } from '@/common/components/Modal' import { TextBig, TextInlineBig } from '@/common/components/typography' import { useModal } from '@/common/hooks/useModal' +import { usePolkadotAppLink } from '@/common/hooks/usePolkadotAppLink' import { NominatingRedirectModalCall } from './types' export const NominatingRedirectModal = () => { const { hideModal } = useModal() + const polkadotAppLink = usePolkadotAppLink() return ( @@ -23,13 +25,10 @@ export const NominatingRedirectModal = () => { - + View detailed stats - + Nominate