diff --git a/src/components/Plan/index.jsx b/src/components/Plan/index.jsx index 4749fbb..e4a633c 100644 --- a/src/components/Plan/index.jsx +++ b/src/components/Plan/index.jsx @@ -1,17 +1,26 @@ import React from "react"; import PropTypes from "prop-types"; -function Plan({ plan }) { +function Plan({ initial_plan }) { + + const onChangeDescription = (e) => { + const p = { + ...plan, + plan_description: e.currentTarget.value + }; + savePlan(p); + } + return (

{plan.plan_id}:

-

Description: {plan.plan_description}

+
); } Plan.propTypes = { - plan: PropTypes.object, + plan: PropTypes.object }; export default Plan; diff --git a/src/components/PlanList/index.jsx b/src/components/PlanList/index.jsx index 8079356..c1ae9ec 100644 --- a/src/components/PlanList/index.jsx +++ b/src/components/PlanList/index.jsx @@ -2,13 +2,13 @@ import React from "react"; import PropTypes from "prop-types"; import Plan from "../Plan"; -function PlanList({ plans }) { +function PlanList({ plans, savePlan }) { return (