feat: hide other course participants from students
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<script>
|
<script lang="ts">
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import ChevronDownIcon from 'carbon-icons-svelte/lib/ChevronDown.svelte';
|
import ChevronDownIcon from 'carbon-icons-svelte/lib/ChevronDown.svelte';
|
||||||
import ChevronUpIcon from 'carbon-icons-svelte/lib/ChevronUp.svelte';
|
import ChevronUpIcon from 'carbon-icons-svelte/lib/ChevronUp.svelte';
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
export let handleClick = () => {};
|
export let handleClick = () => {};
|
||||||
export let label = '';
|
export let label = '';
|
||||||
export let isGroupActive = false;
|
export let isGroupActive = false;
|
||||||
export let isExpanded = true;
|
export let isExpanded: boolean | undefined;
|
||||||
export let total = 0;
|
export let total = 0;
|
||||||
export let isLoading = true;
|
export let isLoading = true;
|
||||||
export let isLesson = false;
|
export let isLesson = false;
|
||||||
|
|||||||
@@ -26,11 +26,10 @@
|
|||||||
hideSortIcon: boolean;
|
hideSortIcon: boolean;
|
||||||
isLesson?: boolean;
|
isLesson?: boolean;
|
||||||
isPaidFeature: boolean;
|
isPaidFeature: boolean;
|
||||||
|
isExpanded?: boolean;
|
||||||
show?: () => boolean;
|
show?: () => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
let show: boolean = false;
|
|
||||||
let isLessonActive: boolean = false;
|
|
||||||
let resize = false;
|
let resize = false;
|
||||||
let isDragging = false;
|
let isDragging = false;
|
||||||
let startX: number;
|
let startX: number;
|
||||||
@@ -52,11 +51,6 @@
|
|||||||
|
|
||||||
let navItems: NavItem[] = [];
|
let navItems: NavItem[] = [];
|
||||||
|
|
||||||
function handleMobileChange(isMobile: boolean) {
|
|
||||||
if (isMobile) show = false;
|
|
||||||
else show = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleCursor(event: MouseEvent) {
|
function handleCursor(event: MouseEvent) {
|
||||||
if (!resize && sidebarRef) {
|
if (!resize && sidebarRef) {
|
||||||
const isNearLeftBorder = event.clientX - sidebarRef.getBoundingClientRect().left < 8;
|
const isNearLeftBorder = event.clientX - sidebarRef.getBoundingClientRect().left < 8;
|
||||||
@@ -140,10 +134,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$: handleMobileChange($isMobile);
|
|
||||||
|
|
||||||
$: isLessonActive = $page.url.pathname.includes('/lessons');
|
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
navItems = [
|
navItems = [
|
||||||
{
|
{
|
||||||
@@ -157,7 +147,8 @@
|
|||||||
to: getLessonsRoute($course.id),
|
to: getLessonsRoute($course.id),
|
||||||
hideSortIcon: false,
|
hideSortIcon: false,
|
||||||
isPaidFeature: false,
|
isPaidFeature: false,
|
||||||
isLesson: true
|
isLesson: true,
|
||||||
|
isExpanded: isStudent ? true : $page.url.pathname.includes('/lessons')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Attendance',
|
label: 'Attendance',
|
||||||
@@ -184,7 +175,10 @@
|
|||||||
label: 'People',
|
label: 'People',
|
||||||
to: getNavItemRoute($course.id, 'people'),
|
to: getNavItemRoute($course.id, 'people'),
|
||||||
isPaidFeature: false,
|
isPaidFeature: false,
|
||||||
hideSortIcon: true
|
hideSortIcon: true,
|
||||||
|
show() {
|
||||||
|
return !isStudent;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Certificates',
|
label: 'Certificates',
|
||||||
@@ -248,11 +242,11 @@
|
|||||||
label={navItem.label}
|
label={navItem.label}
|
||||||
handleClick={handleMainGroupClick(navItem.to)}
|
handleClick={handleMainGroupClick(navItem.to)}
|
||||||
isGroupActive={(path || $page.url.pathname) === navItem.to}
|
isGroupActive={(path || $page.url.pathname) === navItem.to}
|
||||||
isExpanded={isLessonActive}
|
|
||||||
total={navItem.isLesson ? ($lessons || []).length : 0}
|
total={navItem.isLesson ? ($lessons || []).length : 0}
|
||||||
isLoading={!$course.id}
|
isLoading={!$course.id}
|
||||||
isLesson={navItem.isLesson}
|
isLesson={navItem.isLesson}
|
||||||
isPaidFeature={navItem.isPaidFeature}
|
isPaidFeature={navItem.isPaidFeature}
|
||||||
|
isExpanded={navItem.isExpanded}
|
||||||
{isStudent}
|
{isStudent}
|
||||||
>
|
>
|
||||||
{#if navItem.isLesson}
|
{#if navItem.isLesson}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
role="presentation"
|
role="presentation"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="mb-4 flex items-center justify-between border border-l-0 border-r-0 border-t-0 border-gray-100 dark:border-neutral-600 p-4 px-5"
|
class="flex items-center justify-between border border-l-0 border-r-0 border-t-0 border-gray-100 dark:border-neutral-600 p-4 px-5"
|
||||||
>
|
>
|
||||||
<p class="text-md m-0 font-medium dark:text-white">
|
<p class="text-md m-0 font-medium dark:text-white">
|
||||||
{modalHeading}
|
{modalHeading}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<div class="flex flex-col items-center space-y-6 text-center">
|
<div class="flex flex-col items-center space-y-6 text-center">
|
||||||
<img src="/verify-email.svg" alt="email verification" />
|
<img src="/verify-email.svg" alt="email verification" />
|
||||||
<p class="font-bold text-xl">Verify your Email</p>
|
<p class="font-bold text-xl">Verify your Email</p>
|
||||||
<p class="text-sm w-[70%] text-gray-700">
|
<p class="text-sm w-[70%] text-gray-500">
|
||||||
We've sent a verification email to {$profile.email} to confirm the validity of the email provided.
|
We've sent a verification email to {$profile.email} to confirm the validity of the email provided.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const VARIANTS_CLASS = {
|
|||||||
'border border-black dark:border-white hover:bg-neutral-600 hover:text-white text-black dark:text-white',
|
'border border-black dark:border-white hover:bg-neutral-600 hover:text-white text-black dark:text-white',
|
||||||
[VARIANTS.NONE]:
|
[VARIANTS.NONE]:
|
||||||
'border-none hover:border-black-300 hover:bg-gray-200 dark:hover:bg-neutral-800 text-black',
|
'border-none hover:border-black-300 hover:bg-gray-200 dark:hover:bg-neutral-800 text-black',
|
||||||
[VARIANTS.TEXT]: 'text-black hover:underline',
|
[VARIANTS.TEXT]: 'text-black dark:text-white hover:underline',
|
||||||
[VARIANTS.LINK]: 'text-primary-500 dark:text-primary-500 hover:underline',
|
[VARIANTS.LINK]: 'text-primary-500 dark:text-primary-500 hover:underline',
|
||||||
[VARIANTS.TEXT_DANGER]:
|
[VARIANTS.TEXT_DANGER]:
|
||||||
'text-red-500 hover:border border-t-0 border-l-0 border-r-0 border-red-300'
|
'text-red-500 hover:border border-t-0 border-l-0 border-r-0 border-red-300'
|
||||||
|
|||||||
Reference in New Issue
Block a user