From 10b0b7544ceb0dfc6171c3d305413e5156ae8559 Mon Sep 17 00:00:00 2001 From: Deepak Date: Mon, 19 Apr 2021 12:32:57 -0500 Subject: [PATCH] Adds authenticated app stuff --- src/components/Plan/index.jsx | 15 ++++++++++++--- src/components/PlanList/index.jsx | 5 +++-- src/screens/AuthenticatedApp.jsx | 29 +++++++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 7 deletions(-) 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 (