Copy fix and fix linking to crrect content in UserContent items on 'open'

This commit is contained in:
austinkelsay 2024-08-24 17:21:35 -05:00
parent 347ca659d3
commit 15738c955e
5 changed files with 19 additions and 24 deletions

View File

@ -64,7 +64,7 @@ const DraftCourseLesson = ({ lesson, course }) => {
<p className='text-xl mt-6'>{lesson?.summary}</p>
{lesson?.additionalLinks && lesson.additionalLinks.length > 0 && (
<div className='mt-6'>
<h3 className='text-lg font-semibold mb-2'>Additional links:</h3>
<h3 className='text-lg font-semibold mb-2'>External links:</h3>
<ul className='list-disc list-inside'>
{lesson.additionalLinks.map((link, index) => (
<li key={index}>

View File

@ -7,27 +7,22 @@ import { useRouter } from "next/router";
const ContentListItem = (content) => {
const { returnImageProxy } = useImageProxy();
const router = useRouter();
const isDraft = Object.keys(content).includes('type');
const isCourse = content && content?.kind === 30004;
const isCourseDraft = content && content?.resources?.length > 0 && !content?.kind;
const isPublishedCourse = content?.kind === 30004;
const isDraftCourse = !content?.kind && content?.draftLessons;
const isResource = content?.kind && content?.kind === 30023;
const isDraft = !content?.kind && !content?.draftLessons;
const handleClick = () => {
let path = '';
if (isDraft) {
path = '/draft';
} else if (isCourse) {
path = '/course';
} else if (isCourseDraft) {
path = `/course/${content.id}/draft`
return router.push(path);
} else {
path = '/details';
console.log(content);
if (isPublishedCourse) {
router.push(`/course/${content.id}`);
} else if (isDraftCourse) {
router.push(`/course/${content.id}/draft`);
} else if (isResource) {
router.push(`/details/${content.id}`);
} else if (isDraft) {
router.push(`/draft/${content.id}`);
}
const fullPath = `${path}/${content.id}`;
router.push(fullPath);
};

View File

@ -248,9 +248,9 @@ const ResourceForm = ({ draft = null, isPublished = false }) => {
</div>
<div className="mt-8 flex-col w-full">
<span className="pl-1 flex items-center">
Additional Links
External Links
<i className="pi pi-info-circle ml-2 cursor-pointer"
data-pr-tooltip="Add any relevant links that pair with this content"
data-pr-tooltip="Add any relevant external links that pair with this content"
data-pr-position="right"
data-pr-at="right+5 top"
data-pr-my="left center-2"

View File

@ -161,9 +161,9 @@ const WorkshopForm = ({ draft = null }) => {
</div>
<div className="mt-8 flex-col w-full">
<span className="pl-1 flex items-center">
Additional Links
External Links
<i className="pi pi-info-circle ml-2 cursor-pointer"
data-pr-tooltip="Add any relevant or additional links that pair with this content"
data-pr-tooltip="Add any relevant external links that pair with this content"
data-pr-position="right"
data-pr-at="right+5 top"
data-pr-my="left center-2"

View File

@ -244,7 +244,7 @@ export default function Draft() {
<p className='text-xl mt-6'>{draft?.summary}</p>
{draft?.additionalLinks && draft.additionalLinks.length > 0 && (
<div className='mt-6'>
<h3 className='text-lg font-semibold mb-2'>Additional links:</h3>
<h3 className='text-lg font-semibold mb-2'>External links:</h3>
<ul className='list-disc list-inside'>
{draft.additionalLinks.map((link, index) => (
<li key={index}>