Sha256: e5de7a4ad1c839979d2c6b1e48c4d795c16a5fa85e9fbd06559378dd7a2e9588

Contents?: true

Size: 733 Bytes

Versions: 9

Compression:

Stored size: 733 Bytes

Contents

import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { useSelector, useDispatch } from 'react-redux';

import PlanWindow from './PlanWindow';
import {
  selectPlanWindow,
  selectStatus,
} from './PlanWindowSelectors';
import {
  getPlanWindow,
  moveGroup,
} from './PlanWindowActions';

const WrappedPlanWindow = ({ id }) => {
  const dispatch = useDispatch();

  const planWindow = useSelector(selectPlanWindow);
  const status = useSelector(selectStatus);

  useEffect(() => {
    dispatch(getPlanWindow(id));
  }, [dispatch]);

  return (<PlanWindow {...planWindow} status={status} />);
};

WrappedPlanWindow.propTypes = {
  id: PropTypes.number.isRequired,
};

export default WrappedPlanWindow;

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foreman_patch-1.2.1 webpack/components/PlanWindow/index.js
foreman_patch-1.2.0 webpack/components/PlanWindow/index.js
foreman_patch-1.2.0.alpha1 webpack/components/PlanWindow/index.js
foreman_patch-1.1.6.alpha5 webpack/components/PlanWindow/index.js
foreman_patch-1.1.6.alpha4 webpack/components/PlanWindow/index.js
foreman_patch-1.1.5 webpack/components/PlanWindow/index.js
foreman_patch-1.1.4 webpack/components/PlanWindow/index.js
foreman_patch-1.1.3 webpack/components/PlanWindow/index.js
foreman_patch-1.1.1 webpack/components/PlanWindow/index.js