Refactor connection

This commit is contained in:
Thomas Nordquist
2019-01-19 14:54:37 +01:00
parent bfcee49e74
commit f3a686b23f
13 changed files with 332 additions and 180 deletions

View File

@@ -21,6 +21,7 @@ interface State {
interface Props {
name: string
connectionId: string
theme: Theme
settingsVisible: boolean
}
@@ -93,17 +94,17 @@ class App extends React.Component<Props, State> {
<TitleBar />
<div style={centerContent}>
<div style={this.getStyles().left}>
<Tree connectionId={this.state.connectionId} didSelectNode={(node: q.TreeNode) => {
<Tree connectionId={this.props.connectionId} didSelectNode={(node: q.TreeNode) => {
this.setState({ selectedNode: node })
}} />
</div>
<div style={this.getStyles().right}>
<Sidebar connectionId={this.state.connectionId} />
<Sidebar connectionId={this.props.connectionId} />
</div>
</div>
</div>
<UpdateNotifier />
<Connection onConnection={(connectionId: string) => this.setState({ connectionId })}/>
<Connection />
</ErrorBoundary>
</div >
)
@@ -113,6 +114,7 @@ class App extends React.Component<Props, State> {
const mapStateToProps = (state: AppState) => {
return {
settingsVisible: state.settings.visible,
connectionId: state.connectionId,
}
}