Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/live lessons #252

Merged
merged 28 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0667ac6
Updated styling for Preview for lessons
Sep 16, 2024
1b54d37
Removed UI for live lessons to work with responsiveness
Sep 16, 2024
ac5374f
Updated styling for navbar
Sep 16, 2024
12bce4c
Updated sidebar styling to match Navbar styling
Sep 16, 2024
cd51cc5
Updated styling for Workspaces Page
Sep 17, 2024
1819136
Updated styling for Workspaces Page
Sep 17, 2024
042de43
Run Formatting and Linting
Sep 17, 2024
d332d2a
Created a way for the user to navigate back to the original Navbar
Sep 17, 2024
cc5593f
Fixed errors from Sidebar.svelte
Sep 17, 2024
0883c58
Updating workspaces styling
Sep 17, 2024
4e46567
Run Formatting and Linting
Sep 17, 2024
f63eb55
Added tests for main navbar
Sep 17, 2024
f4b4659
Added tests for workspace navbar
Sep 17, 2024
0289289
Added tests for workspaces cards
Sep 17, 2024
5daeb45
Added tests for preview page
Sep 17, 2024
a4c43e6
Run Formatting and Linting
Sep 17, 2024
d1beedd
Merged from develop and updated navbar styling
Sep 20, 2024
790ad85
Update Navbar stylings, Card styling and workspace stylings as well a…
Sep 20, 2024
c278375
Updated layout to be the same for all pages
Sep 20, 2024
376caa8
Merge branch 'main' into update/live-lessons
Sep 20, 2024
71c23ac
Updated materials to scale resolution based on hardware
Sep 20, 2024
92f04b6
Experimenting with Live Lesson Responsive Design
Sep 23, 2024
13bbd8b
Formatted code and updating functionality and responsiveness of the code
Sep 23, 2024
4b8a88b
Updated the code for Controls.svelte
Sep 23, 2024
e86c0f8
Updated the code for Live Lessons
Sep 26, 2024
a3e1b2b
Updated the code for Live Lessons
Sep 26, 2024
6ae1af2
Removed some testing
Sep 26, 2024
0bbc41a
Merged from dev
Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
Binary file modified src/bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"axios": "^1.7.2",
"bcrypt": "^5.1.1",
"canvas-confetti": "^1.9.3",
"date-fns": "^4.1.0",
"mongodb": "^6.8.0",
"mongoose": "^8.4.5",
"playroomkit": "^0.0.79",
Expand Down
2 changes: 1 addition & 1 deletion src/src/lib/components/announcements/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$: ({ id, role, announcements } = data);
</script>

<main class="container mx-auto my-2 px-4">
<main class="container mx-auto my-2 mt-24 px-4">
{#if announcements.length === 0}
<div
class="flex h-full w-full flex-col items-center justify-center space-x-8 space-y-16 lg:flex-row lg:space-y-0 2xl:space-x-0"
Expand Down
61 changes: 40 additions & 21 deletions src/src/lib/components/common/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,46 @@
];

const currentLinks = navLinks[role];

const signout = () => {
window.location.href = '/signout';

Check warning on line 37 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L36-L37

Added lines #L36 - L37 were not covered by tests
};
</script>

<Navbar class="fixed start-0 top-0 z-20 w-full border-b px-2 py-2.5 sm:px-4">
<NavBrand href="/">
<img src="images/class-connect-logo.png" class="mr-3 h-8 sm:h-10" alt="ClassConnect Logo" />
<span
class="self-center whitespace-nowrap text-xl font-semibold text-gray-800 transition-colors duration-300 dark:text-white"
>ClassConnect</span
>
</NavBrand>
<NavHamburger />
<NavUl>
{#each currentLinks as { name, href }}
<NavLi {href} active={activeUrl === href}>
{name}
<div class="relative px-8">

Check warning on line 41 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L41

Added line #L41 was not covered by tests
<Navbar class="fixed start-0 top-0 z-20 w-full border-b px-2 sm:px-4 md:py-0.5 lg:py-0.5">
<NavBrand href="/">
<img src="images/class-connect-logo.png" class="mr-3 h-8 sm:h-10" alt="ClassConnect Logo" />
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white"

Check warning on line 45 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L44-L45

Added lines #L44 - L45 were not covered by tests
>ClassConnect</span
>

Check warning on line 47 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L47

Added line #L47 was not covered by tests
</NavBrand>
<NavHamburger />
<NavUl>
{#each [...currentLinks, ...commonLinks] as { name, href }}
<NavLi {href} active={activeUrl === href} class="nav-link font-semibold">
{name}

Check warning on line 53 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L51-L53

Added lines #L51 - L53 were not covered by tests
</NavLi>
{/each}
<NavLi on:click={signout}>
<button

Check warning on line 57 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L56-L57

Added lines #L56 - L57 were not covered by tests
class="w-full transform rounded-lg bg-red-600 px-3.5 py-2 text-left font-semibold text-white transition duration-300 ease-in-out hover:bg-red-700 hover:shadow-xl dark:bg-red-700 dark:hover:bg-red-800"
>
Sign Out
</button>

Check warning on line 61 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L61

Added line #L61 was not covered by tests
</NavLi>
{/each}
{#each commonLinks as { name, href }}
<NavLi {href} active={activeUrl === href}>
{name}
</NavLi>
{/each}
</NavUl>
</Navbar>
</NavUl>
</Navbar>
</div>

Check warning on line 65 in src/src/lib/components/common/Navbar.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/common/Navbar.svelte#L65

Added line #L65 was not covered by tests

<style>
:global(.nav-link) {
padding-top: 0.5rem;
}
@media (max-width: 768px) {
:global(.nav-link) {
padding-left: 1.5rem !important;
font-weight: bold;
}
}
</style>
20 changes: 11 additions & 9 deletions src/src/lib/components/lessons/lesson/AttendanceList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
MicrophoneSolid,
VideoCameraSolid,
VideoCameraOutline,
MicrophoneSlashOutline
MicrophoneSlashSolid
} from 'flowbite-svelte-icons';

import type { Writable } from 'svelte/store';
Expand All @@ -27,28 +27,30 @@
});
</script>

<Listgroup active class="h-dvh p-4">
<Listgroup class="h-dvh rounded-lg bg-white p-4 shadow-lg dark:bg-gray-800">
<h2 class="mb-4 text-lg font-semibold text-gray-900 dark:text-white">
Participants ({participants.length})
</h2>

{#each participants as participant (participant.sessionId)}
<ListgroupItem class="gap-2 text-base font-semibold">
<Avatar src={participant.image} size="xs" />
<ListgroupItem class="flex items-center gap-4 text-base font-semibold">
<Avatar src={participant.image} size="sm" class="shadow-md" />

<p class="text-sm text-gray-500">{participant.name}</p>
<div class="flex flex-col">
<p class="text-gray-900 dark:text-gray-200">{participant.name}</p>
</div>

<div class="ml-auto flex space-x-2">
{#if hasAudio(participant)}
<MicrophoneSolid color="green" />
<MicrophoneSolid class="text-green-500" />
{:else}
<MicrophoneSlashOutline color="red" />
<MicrophoneSlashSolid class="text-red-500" />
{/if}

{#if hasVideo(participant)}
<VideoCameraSolid color="green" />
<VideoCameraSolid class="text-green-500" />
{:else}
<VideoCameraOutline color="red" />
<VideoCameraOutline class="text-red-500" />
{/if}
</div>
</ListgroupItem>
Expand Down
9 changes: 5 additions & 4 deletions src/src/lib/components/lessons/lesson/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
import { onMount, afterUpdate } from 'svelte';
import { Button, Input, Avatar } from 'flowbite-svelte';
import type { Channel, FormatMessageResponse } from 'stream-chat';

import AttendanceList from './AttendanceList.svelte';

export let channel: Channel;

let state: any;
let newMessage = '';
let activeTab = 'Chat';
let activeTab = 'Chat'; // "Chat" by default

Check warning on line 11 in src/src/lib/components/lessons/lesson/Chat.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/Chat.svelte#L11

Added line #L11 was not covered by tests
let chatContainer: HTMLElement;
let messages: FormatMessageResponse[];
let messages: FormatMessageResponse[] = []; // Initialize to avoid undefined

Check warning on line 13 in src/src/lib/components/lessons/lesson/Chat.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/Chat.svelte#L13

Added line #L13 was not covered by tests

onMount(async () => {
state = await channel.watch();
Expand Down Expand Up @@ -43,6 +42,7 @@
</div>
{:else}
<div class="flex h-full flex-col">
<!-- Tabs for Chat and Participants -->
<div class="mb-4 flex space-x-4">
<Button
color={activeTab === 'Chat' ? 'primary' : 'light'}
Expand All @@ -61,8 +61,9 @@
</Button>
</div>

<!-- Chat View -->
{#if activeTab === 'Chat'}
<div class="flex-1 overflow-hidden rounded-lg border border-gray-300 dark:border-gray-600">
<div class="flex-1 overflow-hidden rounded-lg bg-white shadow-lg dark:bg-gray-800">

Check warning on line 66 in src/src/lib/components/lessons/lesson/Chat.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/Chat.svelte#L66

Added line #L66 was not covered by tests
<div
bind:this={chatContainer}
class="h-full overflow-y-auto p-4"
Expand Down
66 changes: 66 additions & 0 deletions src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<script lang="ts">
import { Tabs, TabItem } from 'flowbite-svelte';
import Chat from './Chat.svelte';
import Participant from './Participant.svelte';

Check warning on line 4 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L1-L4

Added lines #L1 - L4 were not covered by tests

let activeTab = 'chat';
let messages: never[] = [];
let participants: any[] = [];

Check warning on line 8 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L6-L8

Added lines #L6 - L8 were not covered by tests

// Populate participants and messages as needed
</script>

<div class="flex h-full flex-col">

Check warning on line 13 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L13

Added line #L13 was not covered by tests
<Tabs style="pills" class="border-b bg-white p-2">
<TabItem open title="Chat" on:click={() => (activeTab = 'chat')}>
<span slot="title" class="flex items-center gap-2">
<svg

Check warning on line 17 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L15-L17

Added lines #L15 - L17 were not covered by tests
class="h-5 w-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path

Check warning on line 24 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L24

Added line #L24 was not covered by tests
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"
></path>
</svg>

Check warning on line 30 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L29-L30

Added lines #L29 - L30 were not covered by tests
Chat
</span>

Check warning on line 32 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L32

Added line #L32 was not covered by tests
</TabItem>
<TabItem title="Participants" on:click={() => (activeTab = 'participants')}>
<span slot="title" class="flex items-center gap-2">
<svg

Check warning on line 36 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L34-L36

Added lines #L34 - L36 were not covered by tests
class="h-5 w-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path

Check warning on line 43 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L43

Added line #L43 was not covered by tests
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"
></path>
</svg>

Check warning on line 49 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L48-L49

Added lines #L48 - L49 were not covered by tests
Participants
</span>

Check warning on line 51 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L51

Added line #L51 was not covered by tests
</TabItem>
</Tabs>

<div class="flex-grow overflow-hidden">
{#if activeTab === 'chat'}

Check warning on line 56 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L55-L56

Added lines #L55 - L56 were not covered by tests
<Chat {messages} />
{:else if activeTab === 'participants'}
<div class="grid grid-cols-1 gap-4 p-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
{#each participants as participant}
<Participant {...participant} />

Check warning on line 61 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L58-L61

Added lines #L58 - L61 were not covered by tests
{/each}
</div>

Check warning on line 63 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L63

Added line #L63 was not covered by tests
{/if}
</div>
</div>

Check warning on line 66 in src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/lessons/lesson/ChatAndParticipant.svelte#L65-L66

Added lines #L65 - L66 were not covered by tests
Loading
Loading