react-redux#MapStateToProps TypeScript Examples

The following examples show how to use react-redux#MapStateToProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PanelEditor.tsx    From grafana-chinese with Apache License 2.0 6 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  const panel = state.panelEditorNew.getPanel();
  const { plugin } = getPanelStateById(state.dashboard, panel.id);

  return {
    location: state.location,
    plugin: plugin,
    panel: state.panelEditorNew.getPanel(),
    data: state.panelEditorNew.getData(),
    initDone: state.panelEditorNew.initDone,
    tabs: getPanelEditorTabs(state.location, plugin),
    uiState: state.panelEditorNew.ui,
  };
}
Example #2
Source File: DashboardPanel.tsx    From grafana-chinese with Apache License 2.0 6 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  const panelState = state.dashboard.panels[props.panel.id];
  if (!panelState) {
    return { plugin: null };
  }

  return {
    plugin: panelState.plugin,
  };
}
Example #3
Source File: AlertTab.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  return {
    angularPanelComponent: state.dashboard.panels[props.panel.id].angularComponent,
  };
}
Example #4
Source File: AngularPanelOptions.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  return {
    angularPanelComponent: state.dashboard.panels[props.panel.id].angularComponent,
  };
}
Example #5
Source File: VisualizationTab.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  return {
    plugin: state.plugins.panels[props.panel.type],
  };
}
Example #6
Source File: SubMenu.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = state => ({
  variables: getVariableClones(state, false),
})
Example #7
Source File: PanelChromeAngular.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  return {
    angularComponent: state.dashboard.panels[props.panel.id].angularComponent,
  };
}
Example #8
Source File: AngularPanelOptions.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, props) => {
  return {
    angularPanelComponent: state.dashboard.panels[props.panel.id].angularComponent,
  };
}
Example #9
Source File: VariableEditorContainer.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = state => ({
  variables: getVariableClones(state, true),
  idInEditor: state.templating.editor.id,
})
Example #10
Source File: VariableEditorEditor.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, ownProps) => ({
  editor: state.templating.editor,
  variable: getVariable(ownProps.identifier.uuid!, state),
})
Example #11
Source File: OptionsPicker.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = state => ({
  picker: state.templating.optionsPicker,
})
Example #12
Source File: QueryVariableEditor.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, OwnProps, StoreState> = (state, ownProps) => ({
  editor: state.templating.editor as VariableEditorState<QueryVariableEditorState>,
})
Example #13
Source File: SignupInvited.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
mapStateToProps: MapStateToProps<ConnectedProps, {}, StoreState> = (state: StoreState) => ({
  code: state.location.routeParams.code,
})