diff --git a/packages/frontend/src/components/common/VerifyWalletDomainBanner.js b/packages/frontend/src/components/common/VerifyWalletDomainBanner.js index 788d712745..a97b03413f 100644 --- a/packages/frontend/src/components/common/VerifyWalletDomainBanner.js +++ b/packages/frontend/src/components/common/VerifyWalletDomainBanner.js @@ -3,6 +3,7 @@ import { Translate } from 'react-localize-redux'; import styled from 'styled-components'; import { IS_MAINNET, SHOW_PRERELEASE_WARNING } from '../../config'; +import getWalletURL from '../../utils/getWalletURL'; import LockIcon from '../svg/LockIcon'; const StyledContainer = styled.div` @@ -51,22 +52,7 @@ const StyledContainer = styled.div` } `; -const getWalletURL = () => { - let networkName = ''; - - if (SHOW_PRERELEASE_WARNING) { - networkName = 'staging.'; - } - if (!IS_MAINNET) { - networkName = 'testnet.'; - } - - return ( - <> - https://wallet.{networkName}near.org - - ); -}; +const getWalletURLString = () => <>https://{getWalletURL(false)}; export default () => { return ( @@ -75,13 +61,13 @@ export default () => {   - {getWalletURL()} + {getWalletURLString()}
- {getWalletURL()} + {getWalletURLString()}
diff --git a/packages/frontend/src/utils/getWalletURL.js b/packages/frontend/src/utils/getWalletURL.js new file mode 100644 index 0000000000..6697514c15 --- /dev/null +++ b/packages/frontend/src/utils/getWalletURL.js @@ -0,0 +1,14 @@ +import { IS_MAINNET, SHOW_PRERELEASE_WARNING } from '../config'; + +export default (https = true) => { + let networkName = ''; + + if (SHOW_PRERELEASE_WARNING) { + networkName = 'staging.'; + } + if (!IS_MAINNET) { + networkName = 'testnet.'; + } + + return `${https ? 'https://' : ''}wallet.${networkName}near.org`; +};