From 13c0e7ba533f4d6a8053637d391ab57eff8d12bb Mon Sep 17 00:00:00 2001 From: swve Date: Mon, 5 Feb 2024 21:47:22 +0100 Subject: [PATCH] feat: add pre-alpha labels on AI modals --- .../(withmenu)/course/[courseuuid]/course.tsx | 36 ++++++++++--------- .../Objects/Activities/AI/AIActivityAsk.tsx | 10 +++--- .../Objects/Editor/AI/AIEditorToolkit.tsx | 2 +- apps/web/components/Objects/Editor/Editor.tsx | 2 +- apps/web/components/Objects/UserAvatar.tsx | 3 +- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx b/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx index 17f9df7b..5f4f5569 100644 --- a/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx +++ b/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx @@ -26,7 +26,7 @@ const CourseClient = (props: any) => { function getLearningTags() { // create array of learnings from a string object (comma separated) - let learnings = course.learnings.split(","); + let learnings = course?.learnings ? course?.learnings.split(",") : []; setLearnings(learnings); } @@ -91,21 +91,25 @@ const CourseClient = (props: any) => {

{course.description}

-

What you will learn

-
- {learnings.map((learning: any) => { - return ( -
-
- -
-

{learning}

-
- ); - } - )} -
+ {learnings.length > 0 && learnings[0] !== "null" && +
+

What you will learn

+
+ {learnings.map((learning: any) => { + return ( +
+
+ +
+

{learning}

+
+ ); + } + )} +
+
+ }

Course Lessons

diff --git a/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx b/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx index 82299393..c4ab2440 100644 --- a/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx +++ b/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx @@ -173,7 +173,7 @@ function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) {
- Experimental + Experimental
@@ -205,7 +205,7 @@ function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) { }
- +
@@ -237,9 +237,9 @@ function AIMessage(props: AIMessageProps) {
{props.message.sender == 'ai' ? ( - + ) : ( - + )}
@@ -283,7 +283,7 @@ const AIMessagePlaceHolder = (props: { activity_uuid: string, sendMessage: any }

Hello - + {session.user.username}, how can we help today ? diff --git a/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx b/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx index 7ff15559..d2babbd0 100644 --- a/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx +++ b/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx @@ -57,7 +57,7 @@ function AIEditorToolkit(props: AIEditorToolkitProps) {

-
AI Editor
+
AI Editor PRE-ALPHA
diff --git a/apps/web/components/Objects/Editor/Editor.tsx b/apps/web/components/Objects/Editor/Editor.tsx index 4e369682..29a9566d 100644 --- a/apps/web/components/Objects/Editor/Editor.tsx +++ b/apps/web/components/Objects/Editor/Editor.tsx @@ -164,7 +164,7 @@ function Editor(props: Editor) { - + diff --git a/apps/web/components/Objects/UserAvatar.tsx b/apps/web/components/Objects/UserAvatar.tsx index 837dd05b..8c6484ae 100644 --- a/apps/web/components/Objects/UserAvatar.tsx +++ b/apps/web/components/Objects/UserAvatar.tsx @@ -14,6 +14,7 @@ type UserAvatarProps = { use_with_session?: boolean rounded?: 'rounded-md' | 'rounded-xl' | 'rounded-lg' | 'rounded-full' | 'rounded' border?: 'border-2' | 'border-4' | 'border-8' + borderColor? : string predefined_avatar?: 'ai' } @@ -56,7 +57,7 @@ function UserAvatar(props: UserAvatarProps) { width={props.width ? props.width : 50} height={props.width ? props.width : 50} src={useAvatar()} - className={`${props.avatar_url && session.user.avatar_image ? '' : 'bg-gray-700'} ${props.border ? 'border ' + props.border : ''} border-white shadow-xl aspect-square w-[${props.width ? props.width : 50}px] h-[${props.width ? props.width : 50}px] ${props.rounded ? props.rounded : 'rounded-xl'}`} + className={`${props.avatar_url && session.user.avatar_image ? '' : 'bg-gray-700'} ${props.border ? 'border ' + props.border : ''} ${props.borderColor ? props.borderColor : 'border-white'} shadow-xl aspect-square w-[${props.width ? props.width : 50}px] h-[${props.width ? props.width : 50}px] ${props.rounded ? props.rounded : 'rounded-xl'}`} /> ) }