Skip to content

Commit

Permalink
Revert "Update datagrid patterns (#139760)"
Browse files Browse the repository at this point in the history
This reverts commit a7d6486.
  • Loading branch information
ntsummers1 committed Sep 24, 2024
1 parent f6bf44c commit 13be294
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions services/ui-src/src/components/fields/DataGrid.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import PropTypes from "prop-types";
import Question from "./Question";
import { connect, useDispatch } from "react-redux";
import { ADD_TO_TOTAL, FINISH_CALCULATION } from "../../store/lastYearTotals";

const DataGrid = ({ question }) => {
const DataGrid = ({ question, lastYearFormData }) => {
const [renderQuestions, setRenderQuestions] = useState([]);
const [questionsToSet, setQuestionsToSet] = useState([]);
const lastYearFormData = useSelector((state) => state.lastYearFormData);
const dispatch = useDispatch();

const rowStyle =
Expand Down Expand Up @@ -149,6 +148,16 @@ const DataGrid = ({ question }) => {

DataGrid.propTypes = {
question: PropTypes.object.isRequired,
year: PropTypes.number.isRequired,
state: PropTypes.string.isRequired,
lastYearFormData: PropTypes.object.isRequired,
};

export default DataGrid;
const mapStateToProps = (state) => ({
year: state.formData[0].contents.section.year,
state: state.formData[0].contents.section.state,
lastYearFormData: state.lastYearFormData,
lastYearTotals: state.lastYearTotals,
});

export default connect(mapStateToProps)(DataGrid);

0 comments on commit 13be294

Please sign in to comment.