Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 96c2e1a

Browse files
committed
UI adjustment for testnet on developement enviornment
1 parent 770aee7 commit 96c2e1a

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

frontend/public/locales/en/common.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"tokenIDPlaceholder": "Enter Token ID",
2929
"mintTokenText" : "Mint your Token",
3030
"connectWalletText": "Connect Wallet",
31+
"ethereumDevNetworkPrompt": "Please Connect to the Ethereum Rinkeby Testnet",
3132
"ethereumNetworkPrompt": "Please Connect to the Ethereum Mainnet",
3233
"availableTokensText": "View the available Token IDs",
3334
"mintPageHeader": "DEVS Token Minter",
@@ -43,5 +44,6 @@
4344
"here": "here",
4445
"errorMinting": "Unable to Mint NFT",
4546
"disconnectWallet": "Disconnect Wallet",
46-
"etherscanMessage": "View your TX on Etherscan"
47+
"etherscanMessage": "View your TX on Etherscan",
48+
"testnet": "Testnet"
4749
}

frontend/src/components/DirectMint/DirectMint.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import WalletConnectProvider from '@walletconnect/web3-provider';
2626
import Web3Modal from 'web3modal';
2727
import { useTranslation } from 'next-i18next';
2828
import {
29+
NODE_ENV,
2930
DEVELOPER_DAO_CONTRACT,
3031
DEVELOPER_DAO_CONTRACT_NETWORK,
3132
ERROR_CODE_TX_REJECTED_BY_USER,
@@ -269,7 +270,12 @@ const DirectMint = ({ developerId }: DirectMintProps) => {
269270
</Modal>
270271
)}
271272

272-
{networkError && <Text color="red">{t('ethereumNetworkPrompt')}</Text>}
273+
{networkError && NODE_ENV === 'development' && (
274+
<Text color="red">{t('ethereumDevNetworkPrompt')}</Text>
275+
)}
276+
{networkError && NODE_ENV === 'production' && (
277+
<Text color="red">{t('ethereumNetworkPrompt')}</Text>
278+
)}
273279
</>
274280
);
275281
};

frontend/src/components/DirectMint/DirectMintBox.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import DirectMint from './DirectMint';
33
import Logo from '../../components/Logo';
44
import {
5+
Badge,
56
Box,
67
Container,
78
Flex,
@@ -11,7 +12,7 @@ import {
1112
Link,
1213
} from '@chakra-ui/react';
1314
import { useTranslation } from 'next-i18next';
14-
import { TOKEN_FINDER_URL } from '../../utils/DeveloperDaoConstants';
15+
import { NODE_ENV, TOKEN_FINDER_URL } from '../../utils/DeveloperDaoConstants';
1516

1617
// Layout for the Direct Mint Box
1718
// used on the minting page
@@ -28,6 +29,9 @@ const DirectMintBox = () => {
2829
>
2930
<Stack spacing={6} align="center">
3031
<Logo w={52} h={52} />
32+
{NODE_ENV === 'development' && (
33+
<Badge colorScheme="orange">{t('testnet')}</Badge>
34+
)}
3135
<Heading fontSize={{ base: '1.25rem', sm: '2rem' }}>
3236
{t('mintPageHeader')}
3337
</Heading>

frontend/src/pages/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useRouter } from 'next/router';
55
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
66
import { useTranslation } from 'next-i18next';
77
import {
8+
NODE_ENV,
89
DEVELOPER_DAO_CONTRACT,
910
DEVELOPER_DAO_CONTRACT_ABI,
1011
DEVELOPER_DAO_CONTRACT_NETWORK_PROVIDER,
@@ -13,6 +14,7 @@ import {
1314
} from '../utils/DeveloperDaoConstants';
1415
import {
1516
chakra,
17+
Badge,
1618
Input,
1719
Text,
1820
Button,
@@ -61,6 +63,9 @@ function App() {
6163
<VStack mx="auto" px={4} spacing={5} w="full" maxW="lg">
6264
<Logo w={32} h={32} />
6365
<VStack w="full">
66+
{NODE_ENV === 'development' && (
67+
<Badge colorScheme="orange">{t('testnet')}</Badge>
68+
)}
6469
<Text fontSize="xl">{t('searchId')}</Text>
6570
<Input
6671
aria-label="Search by developer ID"

0 commit comments

Comments
 (0)