Skip to content

Commit 87b8136

Browse files
committed
feat(Network): added Kovan support
1 parent c1123db commit 87b8136

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

src/components/Wallet/Network.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ export interface NetworkProps {
66
}
77

88
export const Network: React.FC<NetworkProps> = ({ id }) => {
9+
if (id === 42) {
10+
return (
11+
<StyledKovan>
12+
<h4>Kovan</h4>
13+
</StyledKovan>
14+
)
15+
}
916
if (id === 3) {
1017
return (
1118
<StyledRopsten>
@@ -23,6 +30,11 @@ export const Network: React.FC<NetworkProps> = ({ id }) => {
2330
return null
2431
}
2532

33+
const StyledKovan = styled.div`
34+
align-items: center;
35+
color: purple;
36+
`
37+
2638
const StyledRink = styled.div`
2739
align-items: center;
2840
color: ${(props) => props.theme.color.orange[500]};

src/pages/liquidity/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,13 @@ const Liquidity = ({ icons }) => {
119119
</>
120120
)
121121
}
122-
if (!(chainId === 4 || chainId === 1) && active) {
123-
return <Text>Switch to Rinkeby or Mainnet Networks</Text>
122+
if (!(chainId === 42 || chainId === 4 || chainId === 1) && active) {
123+
return (
124+
<>
125+
<Spacer />
126+
<Text>Switch to Rinkeby, Kovan, or Mainnet Networks</Text>
127+
</>
128+
)
124129
}
125130
if (
126131
!MetaMaskOnboarding.isMetaMaskInstalled() ||

src/pages/markets/[...id].tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,13 @@ const Market = ({ market, data }) => {
148148
</>
149149
)
150150
}
151-
if (!(chainId === 4 || chainId === 1) && active) {
152-
return <Text>Switch to Rinkeby or Mainnet Networks</Text>
151+
if (!(chainId === 42 || chainId === 4 || chainId === 1) && active) {
152+
return (
153+
<>
154+
<Spacer />
155+
<Text>Switch to Rinkeby, Kovan, or Mainnet Networks</Text>
156+
</>
157+
)
153158
}
154159
if (
155160
!MetaMaskOnboarding.isMetaMaskInstalled() ||

0 commit comments

Comments
 (0)