Skip to content

Testnets on connection page #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
REACT_APP_API_URL=http://localhost:3001
REACT_APP_ALLOW_SIGNUP=true
REACT_APP_DEV_MODE=false
REACT_APP_MAINTENANCE_MODE=false
REACT_APP_HEAP_PROJECT_ID=111111111
REACT_APP_FULLSTORY_ORG_ID=11111
REACT_APP_FULLSTORY_ORG_ID=11111
1 change: 1 addition & 0 deletions .github/workflows/heroku-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
HD_REACT_APP_MAINTENANCE_MODE: ${{secrets.REACT_APP_MAINTENANCE_MODE}}
HD_REACT_APP_HEAP_PROJECT_ID: ${{secrets.REACT_APP_HEAP_PROJECT_ID}}
HD_REACT_APP_FULLSTORY_ORG_ID: ${{secrets.REACT_APP_FULLSTORY_ORG_ID}}
HD_REACT_APP_DEV_MODE: ${{secrets.REACT_APP_DEV_MODE}}
36 changes: 24 additions & 12 deletions src/components/Config/Config.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useMemo, useState } from 'react';
import { Form, Modal, Button, Typography, Radio, Alert } from 'antd';
import { Form, Modal, Button, Typography, Radio, Alert, Space } from 'antd';
import styled from 'styled-components';

import { Network, ChainId, ConfirmationTime, ethereum, strategyPathKey } from '../../constants';
Expand All @@ -9,6 +9,7 @@ import CopyInput from '../CopyInput';
import PageTitle from '../PageTitle';
import ConnectionSettings from './ConnectionSettings';
import FirefoxAlert from './FirefoxAlert';
import { DEV_MODE } from '../../env';

const { Link, Text } = Typography;

Expand Down Expand Up @@ -49,7 +50,7 @@ function Config() {
if (confirmationTime) {
url += `&confirmationTime=${confirmationTime}`;
}
url += `&network=${network.toLowerCase()}`;
url += `&network=${network}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not lowercase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cause of adding Automates rinkeby testnet rpc i think,
it should be
https://[email protected]&apiKey=&draft=true&network=arbitrumRinkeby

not
https://[email protected]&apiKey=&draft=true&network=arbitrumrinkeby

with lower case it was giving a wrong rpc url.


return url;
}, [confirmationTime, draft, gasPriceAware, network, user.apiKey, user.login]);
Expand Down Expand Up @@ -114,12 +115,20 @@ function Config() {
size="large"
className="title"
>
<img alt="eth-network-icon" src="/assets/eth.svg" width="36" height="36" className="network-icon" />
<Radio value={Network.ethereum} className="radiobuttons">
Ethereum
</Radio>
<img alt="arb-network-icon" src="/assets/arbitrum.svg" width="36" height="36" className="network-icon" />
<Radio value={Network.arbitrum}>Arbitrum (MAGIC)</Radio>
<Space>
<img alt="eth-network-icon" src="/assets/eth.svg" className="network-icon" />
<Radio value={Network.ethereum}>Ethereum</Radio>
<img alt="arb-network-icon" src="/assets/arbitrum.svg" className="network-icon" />
<Radio value={Network.arbitrum}>Arbitrum (MAGIC) </Radio>
</Space>
{DEV_MODE && (
<Space>
<img alt="ropsten-network-icon" src="/assets/eth.svg" className="network-icon" />
<Radio value={Network.ropsten}>Ropsten (TESTNET)</Radio>
<img alt="arb-network-icon" src="/assets/arbitrum.svg" className="network-icon" />
<Radio value={Network.arbitrumRinkeby}>Rinkeby (TESTNET)</Radio>
</Space>
)}
</Radio.Group>

{network === Network.ethereum && (
Expand Down Expand Up @@ -243,18 +252,21 @@ const Container = styled.div`
.title {
font-weight: 300;
margin-bottom: 20px;
text-align: center;
}

.subtitle {
font-weight: 300;
font-size: 1.8rem;
margin-bottom: 20px;
}
.radiobuttons {
margin-right: 90px;
}

.network-icon {
margin: 0 15px 8px;
margin: 3px 15px;
width: 36px;
height: 36px;
}

p {
font-weight: 300;
}
Expand Down
1 change: 1 addition & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export const API_URL = process.env.REACT_APP_API_URL as string;
export const FULLSTORY_ORG_ID = process.env.REACT_APP_FULLSTORY_ORG_ID as string;
export const ALLOW_SIGNUP = isTruthy(process.env.REACT_APP_ALLOW_SIGNUP as any);
export const MAINTENANCE_MODE = isTruthy(process.env.REACT_APP_MAINTENANCE_MODE as any);
export const DEV_MODE = isTruthy(process.env.REACT_APP_DEV_MODE as any);