Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions apps/client/src/components/QRCodeModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import QRCode from 'react-qr-code';
import { Popover, PopoverContent, PopoverTrigger } from './ui/popover';

interface QRCodeModalProps {
roomId: string;
}

export const QRCodeModal: React.FC<QRCodeModalProps> = ({ roomId }: QRCodeModalProps) => {
const joinUrl = `${window.location.origin}/room/${roomId}`;
return (
<Popover>
<PopoverTrigger asChild>
<span className="text-neutral-400 hover:text-white transition-colors cursor-pointer">QR Code</span>
</PopoverTrigger>
<PopoverContent className="w-auto p-4">
<div className="flex flex-col items-center">
<QRCode value={joinUrl} size={200} />
<p className="mt-2 text-sm text-neutral-400">Scan this on another device to join the session</p>
</div>
</PopoverContent>
</Popover>
);
};
15 changes: 12 additions & 3 deletions apps/client/src/components/room/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/// <reference types="lucide-react" />
/// <reference types="motion/react" />
/// <reference types="next/link" />
"use client";
import { useGlobalStore } from "@/store/global";
import { Github, Hash, Users } from "lucide-react";
import { AnimatePresence, motion } from "motion/react";
import Link from "next/link";
import { Github, Hash, Users } from 'lucide-react';
import { AnimatePresence, motion } from 'motion/react';
import Link from 'next/link';
import { SyncProgress } from "../ui/SyncProgress";
import { QRCodeModal } from '../QRCodeModal';

interface TopBarProps {
roomId: string;
Expand Down Expand Up @@ -76,6 +80,11 @@ export const TopBar = ({ roomId }: TopBarProps) => {
>
Full Sync
</button>
{/* Add QR Code Modal button */}
<div className="hidden md:block">|</div>
<div className="hidden md:block">
<QRCodeModal roomId={roomId} />
</div>
</div>

{/* GitHub icon in the top right */}
Expand Down
3 changes: 2 additions & 1 deletion apps/client/src/store/global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ interface GlobalStateValues {
isShuffled: boolean;
}

interface GlobalState extends GlobalStateValues {
export interface GlobalState extends GlobalStateValues {
// Methods
setIsInitingSystem: (isIniting: boolean) => void;
addToUploadHistory: (name: string, id: string) => void;
Expand Down Expand Up @@ -127,6 +127,7 @@ interface GlobalState extends GlobalStateValues {
getCurrentGainValue: () => number;
resetStore: () => void;
}

// Audio sources
const STATIC_AUDIO_SOURCES: StaticAudioSource[] = [
{
Expand Down
5 changes: 5 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"react-qr-code": "^2.0.15",
"turbo": "^2.4.4"
}
}