updated each demo
This commit is contained in:
parent
a65e97ee9a
commit
45ab2a0710
|
|
@ -13,7 +13,7 @@ export const App = ({ customComponentForState }) => {
|
||||||
|
|
||||||
const componentForState = useCallUI({
|
const componentForState = useCallUI({
|
||||||
state,
|
state,
|
||||||
room: () => <Room />,
|
room: <Room />,
|
||||||
...customComponentForState,
|
...customComponentForState,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@ export const Header = () => {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
column-gap: var(--spacing-xxs);
|
column-gap: var(--spacing-xxs);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: var(--spacing-sm);
|
padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-xxs)
|
||||||
|
var(--spacing-sm);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Card, CardHeader, CardBody } from '@custom/shared/components/Card';
|
import { Card, CardHeader, CardBody } from '@custom/shared/components/Card';
|
||||||
import Loader from '@custom/shared/components/Loader';
|
import Loader from '@custom/shared/components/Loader';
|
||||||
import { Well } from '@custom/shared/components/Well';
|
import Well from '@custom/shared/components/Well';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
export const CreatingRoom = ({ onCreated }) => {
|
export const CreatingRoom = ({ onCreated }) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default async function handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
const { privacy, expiryMinutes } = req.body;
|
const { privacy, expiryMinutes, ...rest } = req.body;
|
||||||
|
|
||||||
if (req.method === 'POST') {
|
if (req.method === 'POST') {
|
||||||
console.log(`Creating room on domain ${process.env.DAILY_DOMAIN}`);
|
console.log(`Creating room on domain ${process.env.DAILY_DOMAIN}`);
|
||||||
|
|
@ -16,7 +16,7 @@ export default async function handler(req, res) {
|
||||||
exp: Math.round(Date.now() / 1000) + (expiryMinutes || 5) * 60, // expire in x minutes
|
exp: Math.round(Date.now() / 1000) + (expiryMinutes || 5) * 60, // expire in x minutes
|
||||||
eject_at_room_exp: true,
|
eject_at_room_exp: true,
|
||||||
enable_knocking: privacy !== 'public',
|
enable_knocking: privacy !== 'public',
|
||||||
enable_recording: 'local',
|
...rest,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import App from '@custom/basic-call/components/App';
|
import App from '@custom/basic-call/components/App';
|
||||||
import FlyingEmojiOverlay from '../FlyingEmojis/FlyingEmojisOverlay';
|
import FlyingEmojiOverlay from './FlyingEmojisOverlay';
|
||||||
|
|
||||||
export const AppWithEmojis = () => (
|
export const AppWithEmojis = () => (
|
||||||
<>
|
<>
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { AppWithEmojis as default } from './App';
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
export { FlyingEmojisOverlay } from './FlyingEmojisOverlay';
|
|
||||||
export { FlyingEmojisOverlay as default } from './FlyingEmojisOverlay';
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { Tray as default } from './Tray';
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import Doc from '@custom/basic-call/pages/_document';
|
||||||
|
|
||||||
|
export default Doc;
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import App from '@custom/basic-call/components/App';
|
||||||
|
import Room from '@custom/basic-call/components/Call/Room';
|
||||||
|
import PaginatedVideoGrid from './PaginatedVideoGrid';
|
||||||
|
|
||||||
|
export const AppWithPagination = () => (
|
||||||
|
<App
|
||||||
|
customComponentForState={{
|
||||||
|
room: <Room MainComponent={PaginatedVideoGrid} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default AppWithPagination;
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { AppWithPagination as default } from './App';
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { PaginatedVideoGrid as default } from './PaginatedVideoGrid';
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { Tray as default } from './Tray';
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import Doc from '@custom/basic-call/pages/_document';
|
||||||
|
|
||||||
|
export default Doc;
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import App from '@custom/basic-call/components/App';
|
import App from '@custom/basic-call/components/App';
|
||||||
import { RecordingProvider } from '../../contexts/RecordingProvider';
|
import { RecordingProvider } from '../contexts/RecordingProvider';
|
||||||
|
|
||||||
// Extend our basic call app component with the recording context
|
// Extend our basic call app component with the recording context
|
||||||
export const AppWithRecording = () => (
|
export const AppWithRecording = () => (
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { AppWithRecording as default } from './App';
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
RECORDING_TYPE_CLOUD,
|
RECORDING_TYPE_CLOUD,
|
||||||
RECORDING_UPLOADING,
|
RECORDING_UPLOADING,
|
||||||
useRecording,
|
useRecording,
|
||||||
} from '../../contexts/RecordingProvider';
|
} from '../contexts/RecordingProvider';
|
||||||
|
|
||||||
export const RECORDING_MODAL = 'recording';
|
export const RECORDING_MODAL = 'recording';
|
||||||
|
|
||||||
|
|
@ -75,12 +75,13 @@ export const RecordingModal = () => {
|
||||||
isOpen={currentModals[RECORDING_MODAL]}
|
isOpen={currentModals[RECORDING_MODAL]}
|
||||||
onClose={() => closeModal(RECORDING_MODAL)}
|
onClose={() => closeModal(RECORDING_MODAL)}
|
||||||
actions={[
|
actions={[
|
||||||
<Button fullWidth variant="outline">
|
<Button key="close" fullWidth variant="outline">
|
||||||
Close
|
Close
|
||||||
</Button>,
|
</Button>,
|
||||||
<Button
|
<Button
|
||||||
fullWidth
|
fullWidth
|
||||||
disabled={!disabled}
|
disabled={!disabled}
|
||||||
|
key="record"
|
||||||
onClick={() => handleRecordingClick()}
|
onClick={() => handleRecordingClick()}
|
||||||
>
|
>
|
||||||
{renderButtonLabel()}
|
{renderButtonLabel()}
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export { RecordingModal as default } from './RecordingModal';
|
|
||||||
export { RecordingModal } from './RecordingModal';
|
|
||||||
export { RECORDING_MODAL } from './RecordingModal';
|
|
||||||
|
|
@ -10,8 +10,8 @@ import {
|
||||||
RECORDING_SAVED,
|
RECORDING_SAVED,
|
||||||
RECORDING_UPLOADING,
|
RECORDING_UPLOADING,
|
||||||
useRecording,
|
useRecording,
|
||||||
} from '../../contexts/RecordingProvider';
|
} from '../contexts/RecordingProvider';
|
||||||
import { RECORDING_MODAL } from '../RecordingModal';
|
import { RECORDING_MODAL } from './RecordingModal';
|
||||||
|
|
||||||
export const Tray = () => {
|
export const Tray = () => {
|
||||||
const { openModal } = useUIState();
|
const { openModal } = useUIState();
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { Tray as default } from './Tray';
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import Doc from '@custom/basic-call/pages/_document';
|
||||||
|
|
||||||
|
export default Doc;
|
||||||
|
|
@ -66,7 +66,7 @@ export const useCallUI = ({
|
||||||
return haircheck ? haircheck() : <HairCheck />;
|
return haircheck ? haircheck() : <HairCheck />;
|
||||||
case CALL_STATE_JOINED:
|
case CALL_STATE_JOINED:
|
||||||
return room ? (
|
return room ? (
|
||||||
room()
|
room
|
||||||
) : (
|
) : (
|
||||||
<MessageCard error header="No room component declared" />
|
<MessageCard error header="No room component declared" />
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import App from '@custom/basic-call/components/App';
|
import App from '@custom/basic-call/components/App';
|
||||||
import { ChatProvider } from '../../contexts/ChatProvider';
|
import { ChatProvider } from '../contexts/ChatProvider';
|
||||||
|
|
||||||
// Extend our basic call app component with the chat context
|
// Extend our basic call app component with the chat context
|
||||||
export const AppWithChat = () => (
|
export const AppWithChat = () => (
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { AppWithChat as default } from './App';
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { Aside } from '@custom/shared/components/Aside';
|
||||||
import Button from '@custom/shared/components/Button';
|
import Button from '@custom/shared/components/Button';
|
||||||
import { TextInput } from '@custom/shared/components/Input';
|
import { TextInput } from '@custom/shared/components/Input';
|
||||||
import { useUIState } from '@custom/shared/contexts/UIStateProvider';
|
import { useUIState } from '@custom/shared/contexts/UIStateProvider';
|
||||||
import { useChat } from '../../contexts/ChatProvider';
|
import { useChat } from '../contexts/ChatProvider';
|
||||||
import { useMessageSound } from '../../hooks/useMessageSound';
|
import { useMessageSound } from '../hooks/useMessageSound';
|
||||||
|
|
||||||
export const CHAT_ASIDE = 'chat';
|
export const CHAT_ASIDE = 'chat';
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { ChatAside as default } from './ChatAside';
|
|
||||||
|
|
@ -3,8 +3,8 @@ import React from 'react';
|
||||||
import { TrayButton } from '@custom/shared/components/Tray';
|
import { TrayButton } from '@custom/shared/components/Tray';
|
||||||
import { useUIState } from '@custom/shared/contexts/UIStateProvider';
|
import { useUIState } from '@custom/shared/contexts/UIStateProvider';
|
||||||
import { ReactComponent as IconChat } from '@custom/shared/icons/chat-md.svg';
|
import { ReactComponent as IconChat } from '@custom/shared/icons/chat-md.svg';
|
||||||
import { useChat } from '../../contexts/ChatProvider';
|
import { useChat } from '../contexts/ChatProvider';
|
||||||
import { CHAT_ASIDE } from '../ChatAside/ChatAside';
|
import { CHAT_ASIDE } from './ChatAside';
|
||||||
|
|
||||||
export const Tray = () => {
|
export const Tray = () => {
|
||||||
const { toggleAside } = useUIState();
|
const { toggleAside } = useUIState();
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { Tray as default } from './Tray';
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import Doc from '@custom/basic-call/pages/_document';
|
||||||
|
|
||||||
|
export default Doc;
|
||||||
Loading…
Reference in New Issue