Skip to content

Commit

Permalink
fix: Show domain banner on staging/testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick1904 committed Mar 23, 2022
1 parent 2291967 commit b26cb5b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/components/accounts/RecoverAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ const RecoverAccount = ({
isMobile
}) => {
return (
<>
{IS_MAINNET && <VerifyWalletDomainBanner />}
<>
<VerifyWalletDomainBanner />
<StyledContainer>
<h1><Translate id='recoverAccount.pageTitle' /></h1>
<h2><Translate id='recoverAccount.pageText' /></h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Translate } from 'react-localize-redux';
import styled from 'styled-components';

import { IS_MAINNET, SHOW_PRERELEASE_WARNING } from '../../config';
import LockIcon from '../svg/LockIcon';

const StyledContainer = styled.div`
Expand Down Expand Up @@ -47,16 +48,37 @@ const StyledContainer = styled.div`
}
`;

const getWalletURL = () => {
let networkName = '';

if (SHOW_PRERELEASE_WARNING) {
networkName = 'staging.';
}
if (!IS_MAINNET) {
networkName = 'testnet.';
}

return (
<>
<span>https://</span><span>wallet.{networkName}near.org</span>
</>
);
};

export default () => {
return (
<StyledContainer>
<div className='desktop'>
<LockIcon color='#00C08B' /><Translate id='verifyWalletDomainBanner.title' />&nbsp;<span>https://</span><span>wallet.near.org</span>
<LockIcon color='#00C08B' />
<Translate id='verifyWalletDomainBanner.title' />
&nbsp;
{getWalletURL()}
</div>
<div className='mobile'>
<Translate id='verifyWalletDomainBanner.title' />
<div>
<LockIcon color='#00C08B' /><span>https://</span><span>wallet.near.org</span>
<LockIcon color='#00C08B' />
{getWalletURL()}
</div>
</div>
</StyledContainer>
Expand Down

0 comments on commit b26cb5b

Please sign in to comment.