From e1806c13f8680f02a9cb8ee07dbae77a4ef7f196 Mon Sep 17 00:00:00 2001 From: Elhamne Date: Sat, 25 Feb 2023 12:41:17 +0330 Subject: [PATCH] Disabled grow family for gone child, #13 --- src/components/child/MyChildTabs.jsx | 5 +++-- src/pages/child/MyChildPage.jsx | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/child/MyChildTabs.jsx b/src/components/child/MyChildTabs.jsx index 1f488657..30717afd 100644 --- a/src/components/child/MyChildTabs.jsx +++ b/src/components/child/MyChildTabs.jsx @@ -54,12 +54,11 @@ function a11yProps(index) { }; } -export default function MyChildTabs({ theChild }) { +export default function MyChildTabs({ theChild, isGone, setIsGone }) { const dispatch = useDispatch(); const location = useLocation(); const { t } = useTranslation(); - const [isGone, setIsGone] = useState(false); const [value, setValue] = useState(0); const [userRole, setUserRole] = useState(); const [needsData, setNeedsData] = useState([]); @@ -205,4 +204,6 @@ export default function MyChildTabs({ theChild }) { MyChildTabs.propTypes = { theChild: PropTypes.object, + isGone: PropTypes.bool, + setIsGone: PropTypes.func, }; diff --git a/src/pages/child/MyChildPage.jsx b/src/pages/child/MyChildPage.jsx index dd079bd5..1612364a 100644 --- a/src/pages/child/MyChildPage.jsx +++ b/src/pages/child/MyChildPage.jsx @@ -76,7 +76,8 @@ const MyChildPage = () => { const [myChildrenIdList, setMyChildrenIdList] = useState([]); const [leaveOpen, setLeaveOpen] = useState(false); const [growOpen, setGrowOpen] = useState(false); - const [anchorEl, setAnchorEl] = React.useState(null); // Menu + const [anchorEl, setAnchorEl] = useState(null); // Menu + const [isGone, setIsGone] = useState(false); const open = Boolean(anchorEl); // Menu const myHome = useSelector((state) => state.myHome); @@ -227,6 +228,7 @@ const MyChildPage = () => { }} > @@ -279,7 +281,13 @@ const MyChildPage = () => { - {theChild && } + {theChild && ( + + )} )}