Merge pull request #176 from varasev/dai-netid

(Feature) Add poa-chain-spec branch name and netId for DAI shard
This commit is contained in:
Vadim Arasev 2018-10-02 16:38:25 +03:00 committed by GitHub
commit dc1a567b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 7 deletions

View File

@ -107,9 +107,11 @@ class App extends Component {
return this.state.navigationData[0].title return this.state.navigationData[0].title
} }
} }
getNetIdClass() { getNetIdClass() {
const { contractsStore } = this.props const { contractsStore } = this.props
return contractsStore.netId === '77' ? 'sokol' : '' const netId = contractsStore.netId
return netId === '77' || netId === '79' ? 'sokol' : ''
} }
render() { render() {
@ -139,7 +141,7 @@ class App extends Component {
{search} {search}
<div <div
className={`app-container ${this.state.showMobileMenu ? 'app-container-open-mobile-menu' : ''} ${ className={`app-container ${this.state.showMobileMenu ? 'app-container-open-mobile-menu' : ''} ${
contractsStore.netId === '77' ? 'sokol' : '' contractsStore.netId === '77' || contractsStore.netId === '79' ? 'sokol' : ''
}`} }`}
> >
<div className="container"> <div className="container">

View File

@ -10,8 +10,10 @@ const styles = netId => {
switch (netId) { switch (netId) {
case '77': case '77':
case '79':
return sokol return sokol
case '99': case '99':
case '100':
return core return core
default: default:
return {} return {}

View File

@ -4,7 +4,8 @@ import { Link } from 'react-router-dom'
import Socials from './Socials.jsx' import Socials from './Socials.jsx'
export const Footer = ({ netId }) => { export const Footer = ({ netId }) => {
const footerClassName = netId === '77' ? 'sokol' : '' const isTestnet = netId === '77' || netId === '79'
const footerClassName = isTestnet ? 'sokol' : ''
return ( return (
<footer className={`footer ${footerClassName}`}> <footer className={`footer ${footerClassName}`}>

View File

@ -9,10 +9,11 @@ import NavigationLinks from './NavigationLinks.jsx'
import MobileMenuLinks from './MobileMenuLinks.jsx' import MobileMenuLinks from './MobileMenuLinks.jsx'
export const Header = ({ netId, baseRootPath, navigationData, showMobileMenu, onMenuToggle }) => { export const Header = ({ netId, baseRootPath, navigationData, showMobileMenu, onMenuToggle }) => {
const headerClassName = netId === '77' ? 'sokol' : '' const isTestnet = netId === '77' || netId === '79'
const logoImageName = netId === '77' ? logoSokol : logoBase const headerClassName = isTestnet ? 'sokol' : ''
const menuIcon = netId === '77' ? menuIconSokol : menuIconBase const logoImageName = isTestnet ? logoSokol : logoBase
const menuOpenIcon = netId === '77' ? menuOpenIconSokol : menuOpenIconBase const menuIcon = isTestnet ? menuIconSokol : menuIconBase
const menuOpenIcon = isTestnet ? menuOpenIconSokol : menuOpenIconBase
return ( return (
<header className={`header ${headerClassName}`}> <header className={`header ${headerClassName}`}>

View File

@ -10,6 +10,8 @@ import { addressesURL, wrongRepoAlert } from './helpers'
let SOKOL_ADDRESSES = {} let SOKOL_ADDRESSES = {}
let CORE_ADDRESSES = {} let CORE_ADDRESSES = {}
let DAI_TEST_ADDRESSES = {}
let DAI_ADDRESSES = {}
async function getContractsAddresses(branch) { async function getContractsAddresses(branch) {
let addr = addressesURL(branch) let addr = addressesURL(branch)
@ -26,9 +28,15 @@ async function getContractsAddresses(branch) {
case 'core': case 'core':
CORE_ADDRESSES = contracts CORE_ADDRESSES = contracts
break break
case 'dai':
DAI_ADDRESSES = contracts
break
case 'sokol': case 'sokol':
SOKOL_ADDRESSES = contracts SOKOL_ADDRESSES = contracts
break break
case 'dai-test':
DAI_TEST_ADDRESSES = contracts
break
default: default:
CORE_ADDRESSES = contracts CORE_ADDRESSES = contracts
break break
@ -39,8 +47,12 @@ function getAddresses(netId) {
switch (netId) { switch (netId) {
case '77': case '77':
return SOKOL_ADDRESSES return SOKOL_ADDRESSES
case '79':
return DAI_TEST_ADDRESSES
case '99': case '99':
return CORE_ADDRESSES return CORE_ADDRESSES
case '100':
return DAI_ADDRESSES
default: default:
return CORE_ADDRESSES return CORE_ADDRESSES
} }

View File

@ -31,8 +31,12 @@ function getBranch(netId) {
switch (netId) { switch (netId) {
case '77': case '77':
return 'sokol' return 'sokol'
case '79':
return 'dai-test'
case '99': case '99':
return 'core' return 'core'
case '100':
return 'dai'
default: default:
return 'core' return 'core'
} }

View File

@ -16,10 +16,18 @@ let getWeb3 = () => {
let netIdName let netIdName
console.log('netId', netId) console.log('netId', netId)
switch (netId) { switch (netId) {
case '100':
netIdName = 'Dai'
console.log('This is Dai', netId)
break
case '99': case '99':
netIdName = 'Core' netIdName = 'Core'
console.log('This is Core', netId) console.log('This is Core', netId)
break break
case '79':
netIdName = 'Dai-Test'
console.log('This is Dai-Test', netId)
break
case '77': case '77':
netIdName = 'Sokol' netIdName = 'Sokol'
console.log('This is Sokol', netId) console.log('This is Sokol', netId)