Skip to content

Commit

Permalink
Add settings only to portfolio page
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincharles committed Mar 21, 2023
1 parent 906c661 commit e135d52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Tools/_framework/Panels/NewSupportPanel.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import styled from 'styled-components';
import {
useRecoilState,
useRecoilValue,
} from 'recoil';
import Button from '../../../_reactComponents/PanelHeaderComponents/Button';
import { useNavigate } from 'react-router';
import { searchParamAtomFamily } from '../NewToolRoot';
import { pageToolViewAtom, searchParamAtomFamily } from '../NewToolRoot';
// import { courseIdAtom } from '../../../_reactComponents/Course/CourseActions';

const SupportWrapper = styled.div`
Expand All @@ -31,6 +32,10 @@ export default function SupportPanel({ hide, children, panelTitles=[], panelInde
// console.log(">>>===SupportPanel")
const navigate = useNavigate();
const doenetId = useRecoilValue(searchParamAtomFamily('doenetId'))
//NEED THE ROOT PATH BEFORE THE ?
const recoilPageToolView = useRecoilValue(pageToolViewAtom);
/* const recoilTool = useRecoilValue(searchParamAtomFamily('source')); */
/* console.log("recoilPageToolView",recoilPageToolView?.page) */
/* const courseId = useRecoilValue(courseIdAtom) */


Expand All @@ -54,7 +59,7 @@ export default function SupportPanel({ hide, children, panelTitles=[], panelInde
return (
<>
<ControlsWrapper $hide={hide} aria-label="complementary controls" data-test="Support Panel Controls">
<Button value="Settings" onClick={()=>navigate(`/portfolio/${doenetId}/settings`)}/>
{recoilPageToolView?.page == 'portfolio' ? <Button value="Settings" onClick={()=>navigate(`/portfolio/${doenetId}/settings`)}/> : null }
<Button value="Documentation" onClick={()=>window.open("/public?tool=editor&doenetId=_DG5JOeFNTc5rpWuf2uA-q")}/>
</ControlsWrapper>
<SupportWrapper $hide={hide} role="complementary" data-test="Support Panel">{children}</SupportWrapper>
Expand Down

0 comments on commit e135d52

Please sign in to comment.