Skip to content

Commit

Permalink
Update datagrid patterns (#139760)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrabian authored Sep 9, 2024
1 parent 3dbba17 commit a7d6486
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions services/ui-src/src/components/fields/DataGrid.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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, lastYearFormData }) => {
const DataGrid = ({ question }) => {
const [renderQuestions, setRenderQuestions] = useState([]);
const [questionsToSet, setQuestionsToSet] = useState([]);
const lastYearFormData = useSelector((state) => state.lastYearFormData);
const dispatch = useDispatch();

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

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

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);
export default DataGrid;

0 comments on commit a7d6486

Please sign in to comment.