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
aa8c976
commit 010c561
Showing
6 changed files
with
462 additions
and
302 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React, { Suspense } from 'react'; | ||
import Button from '../../../_reactComponents/PanelHeaderComponents/Button'; | ||
import { useNavigate, useLoaderData } from 'react-router'; | ||
|
||
export default function PublicNavigation() { | ||
const navigate = useNavigate(); | ||
// const { isPortfolioCourse, doenetId, courseId } = useLoaderData(); | ||
const { signedIn, portfolioCourseId } = useLoaderData(); | ||
return ( | ||
<Suspense fallback={<div>loading Breadcrumbs...</div>}> | ||
<div style={{ display: 'flex', columnGap: '4px', marginRight: '16px' }}> | ||
<Button | ||
value="Home" | ||
onClick={() => { | ||
navigate('/'); | ||
}} | ||
/> | ||
<Button | ||
value="Community" | ||
onClick={() => { | ||
navigate('/community'); | ||
}} | ||
/> | ||
{signedIn ? ( | ||
<> | ||
<Button | ||
value="Portfolio" | ||
onClick={() => { | ||
navigate(`/portfolio/${portfolioCourseId}`); | ||
}} | ||
/> | ||
</> | ||
) : null} | ||
{/* {isPortfolioCourse == '1' ? ( | ||
<> | ||
<Button | ||
value="Portfolio" | ||
onClick={() => { | ||
navigate(`/publicportfolio/${courseId}`); | ||
}} | ||
/> | ||
<Button | ||
value="Viewer" | ||
onClick={() => { | ||
navigate(`/portfolioviewer/${doenetId}`); | ||
}} | ||
/> | ||
</> | ||
) : null} */} | ||
</div> | ||
</Suspense> | ||
); | ||
} |
47 changes: 47 additions & 0 deletions
47
src/Tools/_framework/MenuPanelCaps/PublicEditorInfoCap.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,47 @@ | ||
import { Box, Image } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
import { useLoaderData } from 'react-router'; | ||
|
||
export async function loader({ params }) { | ||
const doenetId = params.doenetId; | ||
const response = await fetch( | ||
`/api/getPortfolioActivityData.php?doenetId=${doenetId}`, | ||
); | ||
const data = await response.json(); | ||
|
||
return data.activityData; | ||
} | ||
|
||
export default function PublicEditorInfoCap() { | ||
let { activityData } = useLoaderData(); | ||
let imagePath = '/activity_default.jpg'; | ||
if (activityData?.imagePath != null) { | ||
imagePath = activityData?.imagePath; | ||
} | ||
return ( | ||
<> | ||
<Box | ||
height="130px" | ||
width="100%" | ||
// width="180px" | ||
background="black" | ||
overflow="hidden" | ||
// border="2px solid #949494" | ||
// borderRadius= "6px" | ||
margin="auto" | ||
> | ||
<Image | ||
width="100%" | ||
height="100%" | ||
objectFit="contain" | ||
src={imagePath} | ||
alt="Activity Image" | ||
/> | ||
</Box> | ||
<div style={{ marginBottom: '5px', padding: '1px 5px' }}> | ||
Public Activity Editor | ||
</div> | ||
{/* <div style={{ marginBottom: "5px",padding:'1px 5px' }}>{data.label}</div> */} | ||
</> | ||
); | ||
} |
Oops, something went wrong.