Skip to content

Commit

Permalink
use @obsidians/network
Browse files Browse the repository at this point in the history
  • Loading branch information
qftgtr committed Sep 24, 2020
1 parent db914b5 commit fbc04da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const overrides = [
'@obsidians/bottombar': `@obsidians/${process.env.BUILD}-bottombar`,
'@obsidians/explorer': `@obsidians/${process.env.BUILD}-explorer`,
'@obsidians/header': `@obsidians/${process.env.BUILD}-header`,
'@obsidians/instances': `@obsidians/${process.env.BUILD}-instances`,
'@obsidians/network': `@obsidians/${process.env.BUILD}-network`,
'@obsidians/project': `@obsidians/${process.env.BUILD}-project`,
'@obsidians/sdk': `@obsidians/${process.env.BUILD}-sdk`,
'@obsidians/welcome': `@obsidians/${process.env.BUILD}-welcome`,
Expand Down
2 changes: 1 addition & 1 deletion src.main/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { IpcChannel } = require('@obsidians/ipc')
const KeypairManager = require('@obsidians/keypair')
const { AutoUpdate } = require('@obsidians/global')
const CompilerManager = require('@obsidians/conflux-compiler')
const { InstanceManager } = require('@obsidians/conflux-instances')
const { InstanceManager } = require('@obsidians/conflux-network')
const ProjectChannel = require('@obsidians/conflux-project')

let ipcChannel, keypairManager, autoUpdate, compilerManager, instanceManager, projectChannel
Expand Down
4 changes: 3 additions & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React, { PureComponent } from 'react'

import redux, { connect } from '@obsidians/redux'
import headerActions, { networks, Header, NavGuard } from '@obsidians/header'

import headerActions, { Header, NavGuard } from '@obsidians/header'
import { networks } from '@obsidians/network'
import { actions } from '@obsidians/project'

class HeaderWithRedux extends PureComponent {
Expand Down
24 changes: 5 additions & 19 deletions src/components/Routes/Network.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import React, { PureComponent } from 'react'

import redux, { connect } from '@obsidians/redux'
import { InstanceList } from '@obsidians/instances'

import { withRouter } from 'react-router-dom'

const onLifecycle = ({ lifecycle, runningInstance, algoNode }) => {
switch (lifecycle) {
case 'stopped':
redux.dispatch('UPDATE_UI_STATE', { localNetwork: '', algoNode: '' })
break
case 'started':
redux.dispatch('UPDATE_UI_STATE', { localNetwork: runningInstance, algoNode })
break
default:
}
}
import { connect } from '@obsidians/redux'
import Network from '@obsidians/network'

class Network extends PureComponent {
class NetworkWithProps extends PureComponent {
state = {
active: true
}
Expand All @@ -29,9 +16,8 @@ class Network extends PureComponent {

render () {
return (
<InstanceList
<Network
network={this.props.network}
onLifecycle={onLifecycle}
active={this.state.active}
/>
)
Expand All @@ -41,4 +27,4 @@ class Network extends PureComponent {

export default connect([
'network',
])(withRouter(Network))
])(withRouter(NetworkWithProps))

0 comments on commit fbc04da

Please sign in to comment.