Skip to content

Commit

Permalink
Disabled grow family for gone child, #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Elhamne committed Feb 25, 2023
1 parent 8359e20 commit e1806c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/child/MyChildTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down Expand Up @@ -205,4 +204,6 @@ export default function MyChildTabs({ theChild }) {

MyChildTabs.propTypes = {
theChild: PropTypes.object,
isGone: PropTypes.bool,
setIsGone: PropTypes.func,
};
12 changes: 10 additions & 2 deletions src/pages/child/MyChildPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -227,6 +228,7 @@ const MyChildPage = () => {
}}
>
<MenuItem
disabled={isGone}
onClick={handleGrow}
sx={{ minHeight: '15px', margin: 1 }}
>
Expand Down Expand Up @@ -279,7 +281,13 @@ const MyChildPage = () => {
</Grid>
</Grid>
<Grid sx={{ maxWidth: '100% !important' }}>
{theChild && <MyChildTabs theChild={theChild} />}
{theChild && (
<MyChildTabs
theChild={theChild}
isGone={isGone}
setIsGone={setIsGone}
/>
)}
</Grid>
</Grid>
)}
Expand Down

1 comment on commit e1806c1

@vercel
Copy link

@vercel vercel bot commented on e1806c1 Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

front-end-v2 – ./

beta.sayapp.company
front-end-v2-saydao.vercel.app
front-end-v2-git-release-saydao.vercel.app

Please sign in to comment.