fix: setup buttons not clicking
This commit is contained in:
@@ -15,20 +15,20 @@
|
|||||||
let completed = 0;
|
let completed = 0;
|
||||||
|
|
||||||
const StepsEnum = {
|
const StepsEnum = {
|
||||||
UPDATE_PROFILE: 'Upload a profile picture and update username',
|
UPDATE_PROFILE: 'profile',
|
||||||
UPDATE_ORG_PROFILE: 'Update organisation profile picture',
|
UPDATE_ORG_PROFILE: 'organization',
|
||||||
CREATE_COURSE: 'Create Course',
|
CREATE_COURSE: 'course',
|
||||||
CREATE_LESSON: 'Create a lesson',
|
CREATE_LESSON: 'lesson',
|
||||||
CREATE_EXERCISE: 'Create an exercise',
|
CREATE_EXERCISE: 'exercise',
|
||||||
PUBLISH_COURSE: 'Publish a course'
|
PUBLISH_COURSE: 'publish'
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCompleted = (id) => {
|
const isCompleted = (id) => {
|
||||||
return setupList?.find((c) => c.id === id)?.is_completed == true;
|
return setupList?.find((c) => c.id === id)?.is_completed == true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = (title) => {
|
const handleClick = (id) => {
|
||||||
switch (title) {
|
switch (id) {
|
||||||
case StepsEnum.CREATE_COURSE:
|
case StepsEnum.CREATE_COURSE:
|
||||||
goto(`/org/${$currentOrg.siteName}/courses?create=true`);
|
goto(`/org/${$currentOrg.siteName}/courses?create=true`);
|
||||||
break;
|
break;
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
variant={list.is_completed ? VARIANTS.CONTAINED_DARK : VARIANTS.OUTLINED}
|
variant={list.is_completed ? VARIANTS.CONTAINED_DARK : VARIANTS.OUTLINED}
|
||||||
className="!w-full font-normal text-sm flex items-center gap-2"
|
className="!w-full font-normal text-sm flex items-center gap-2"
|
||||||
onClick={() => handleClick(list.title)}
|
onClick={() => handleClick(list.id)}
|
||||||
isDisabled={list.is_completed}
|
isDisabled={list.is_completed}
|
||||||
>
|
>
|
||||||
{#if list.is_completed}
|
{#if list.is_completed}
|
||||||
|
|||||||
Reference in New Issue
Block a user