Skip to content

Commit

Permalink
bring tutors time into main app
Browse files Browse the repository at this point in the history
  • Loading branch information
edeleastar committed Jan 6, 2025
1 parent afb908e commit 6c3c5b3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/services/types.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class LoRecord {
*/
export interface CardDetails {
route: string;
title: string;
title?: string;
type: string;
summary?: string;
summaryEx?: string;
Expand Down
7 changes: 1 addition & 6 deletions src/lib/ui/navigators/tutors-connect/ConnectedProfile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@
type="tutorsTime"
targetStr="_blank"
/>
<MenuItem
link="https://live.tutors.dev/course/{currentCourse.value?.courseId}"
text="Tutors Live"
type="live"
targetStr="_blank"
/>
<MenuItem link="/live/{currentCourse.value?.courseId}" text="Tutors Live" type="live" />

<li class="option !p-0 hover:preset-tonal">
<OnlineButton />
Expand Down
20 changes: 20 additions & 0 deletions src/lib/ui/time/Course.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script lang="ts">
import { presenceService } from "$lib/services/presence.svelte";
import Card from "../components/Card.svelte";
</script>

<div class="flex flex-wrap justify-center">
{#each presenceService.studentsOnline.value as lo}
<Card
cardDetails={{
route: lo.loRoute,
title: lo.courseTitle,
type: lo.type,
summary: lo.title,
summaryEx: "(" + lo.type + ")",
img: lo.img,
icon: lo.icon
}}
/>
{/each}
</div>
15 changes: 15 additions & 0 deletions src/routes/(live)/live/[courseid]/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script lang="ts">
import { presenceService } from "$lib/services/presence.svelte";
import Course from "$lib/ui/time/Course.svelte";
interface Props {
data: any;
}
let { data }: Props = $props();
if (presenceService.listeningTo !== data.courseid) {
presenceService.startPresenceListener(data.courseid);
}
</script>

<Course />
6 changes: 6 additions & 0 deletions src/routes/(live)/live/[courseid]/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const load = async ({ params, parent, fetch }) => {
// presenceService.startCoursePresenceListener(params.courseid);
return {
courseid: params.courseid
};
};

0 comments on commit 6c3c5b3

Please sign in to comment.