hide preview session button

This commit is contained in:
Nuwan 2023-11-05 19:49:34 +05:30
parent 10e67e4cbb
commit b7615c3fcd
3 changed files with 29 additions and 23 deletions

View File

@ -1,38 +1,34 @@
import { mergePartially, NestedPartial } from 'merge-partially';
import { faker } from '@faker-js/faker';
import { IUser } from './user';
interface User {
id: string;
name: string;
}
interface Track {
interface ITrack {
id: string;
instrument: string;
}
interface Participant {
interface IParticipant {
id: string;
client_id: string;
user: User;
tracks: Track[];
user: IUser;
tracks: ITrack[];
}
interface Invitations {
interface IInvitations {
id: string;
sender_id?: string;
receiver_id?: string;
}
interface Session {
interface ISession {
id: string;
name: string;
description: string;
participants?: Participant[];
invitations?: Invitations[];
participants?: IParticipant[];
invitations?: IInvitations[];
}
export default function makeFakeSession(overrides?: NestedPartial<Session>): Session {
export default function makeFakeSession(overrides?: NestedPartial<ISession>): ISession {
return mergePartially.deep(
{
id: faker.string.uuid(),
@ -44,7 +40,6 @@ export default function makeFakeSession(overrides?: NestedPartial<Session>): Ses
client_id: faker.string.uuid(),
user: {
id: faker.string.uuid(),
name: faker.person.firstName(),
},
tracks: [{
id: faker.string.uuid(),

View File

@ -1,20 +1,31 @@
import { mergePartially, NestedPartial } from 'merge-partially';
import { faker } from '@faker-js/faker';
interface IUser {
export interface IUser {
id: string;
firstName: string;
lastName: string;
email: string;
name?: string;
firstName?: string;
lastName?: string;
email?: string;
city?: string;
state?: string;
country?: string;
biography?: string;
online?: boolean;
musician?: boolean;
photo_url?: string;
}
export default function makeFakeUser(overrides?: NestedPartial<IUser>): IUser {
const fname: string = faker.person.firstName();
const lname: string = faker.person.lastName();
return mergePartially.deep(
{
id: faker.string.uuid(),
email: faker.internet.email(),
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
firstName: fname,
lastName: lname,
name: fname + ' ' + lname,
},
overrides
);

View File

@ -67,7 +67,7 @@ function JKSession({ session }) {
<Button onClick={joinSession} color="primary" data-testid="joinBtn" className="btn-join mr-1 mb-1">
<FontAwesomeIcon icon="arrow-right" transform="shrink-4 down-1" className="mr-1" />
</Button>
<Button
{/* <Button
color="primary"
onClick={() =>
console.log(`TODO: If the user
@ -75,7 +75,7 @@ clicks this button, we open an audio stream using Icecast server to let the user
}
>
<FontAwesomeIcon icon="volume-up" transform="shrink-4 down-1" className="mr-1" />
</Button>
</Button> */}
</div>
);
};