Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-15 18:58:30 +03:00
1 parent 693385a0a0
commit ae9afc2894
5 files changed
+24 -32

No files matched your search

@@ -1,30 +0,0 @@
import React from "react";
import { observer } from "mobx-react";
import { ClusterId, clusterStore } from "../../../common/cluster-store";
import { WorkspaceId, workspaceStore } from "../../../common/workspace-store";
export const clusterContext = React.createContext(getClusterContext());
export interface ClusterContextValue {
workspaceId: WorkspaceId;
clusterId?: ClusterId;
}
export function getClusterContext(): ClusterContextValue {
return {
clusterId: clusterStore.activeClusterId,
workspaceId: workspaceStore.currentWorkspaceId,
}
}
@observer
export class ClusterContext extends React.Component {
render() {
const { Provider } = clusterContext;
return (
<Provider value={getClusterContext()}>
{this.props.children}
</Provider>
)
}
}
View File
Whitespace-only changes.