forked from Doenet/DoenetTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee6dcd9
commit 4772f60
Showing
5 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/Tools/_framework/MenuPanelCaps/PortfilioEditorInfoCap.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { set } from 'idb-keyval'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { itemByDoenetId, courseIdAtom, useCourse } from '../../../_reactComponents/Course/CourseActions'; | ||
import { searchParamAtomFamily } from '../NewToolRoot'; | ||
// import { ClipboardLinkButtons } from '../ToolHandlers/CourseToolHandler'; | ||
// import { find_image_label, find_color_label } from './util' | ||
|
||
export default function PortfilioEditorInfoCap(){ | ||
const doenetId = useRecoilValue(searchParamAtomFamily('doenetId')); | ||
const [data,setData] = useState({}) | ||
|
||
// const activityInfo = useRecoilValue(itemByDoenetId(doenetId)); | ||
// const courseId = useRecoilValue(courseIdAtom); | ||
// const pageId = useRecoilValue(searchParamAtomFamily('pageId')); | ||
// const pageInfo = useRecoilValue(itemByDoenetId(pageId)); | ||
|
||
|
||
useEffect(()=>{ | ||
//Move this to loader when using React Router | ||
async function loadData(){ | ||
const response = await fetch(`/api/getPortfolioActivityData.php?doenetId=${doenetId}`); | ||
const respdata = await response.json(); | ||
setData(respdata.activityData); | ||
} | ||
if (doenetId){ | ||
loadData(); | ||
} | ||
},[doenetId]) | ||
|
||
if (!data?.label){ return null;} | ||
|
||
// console.log("data",data) | ||
|
||
|
||
return <> | ||
<div style={{ position: "relative", width: "100%", height:"124px", overflow: "hidden"}}> | ||
<img src={data.imagePath} alt="Activity Thumbnail"/> | ||
</div> | ||
<div style={{ marginBottom: "5px",padding:'1px 5px' }}>Portfolio Activity Editor</div> | ||
{/* <div style={{ marginBottom: "5px",padding:'1px 5px' }}>{data.label}</div> */} | ||
</> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters