Skip to content

Commit

Permalink
Fix dev conflicts (#3088)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 authored Jul 16, 2024
2 parents ead4c76 + 14ae401 commit 8b53bf4
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 40 deletions.
2 changes: 1 addition & 1 deletion examples/prebuilt-react-integration/package.json

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

4 changes: 2 additions & 2 deletions packages/hls-player/package.json

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

2 changes: 1 addition & 1 deletion packages/hls-stats/package.json

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

2 changes: 1 addition & 1 deletion packages/hms-video-store/package.json

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

6 changes: 3 additions & 3 deletions packages/hms-virtual-background/package.json

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

2 changes: 1 addition & 1 deletion packages/hms-whiteboard/package.json

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

14 changes: 4 additions & 10 deletions packages/hms-whiteboard/src/ErrorFallback.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { ComponentType, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useValue } from '@tldraw/state';
import { Editor, hardResetEditor, refreshPage } from '@tldraw/tldraw';
import { Editor, hardResetEditor } from '@tldraw/tldraw';
import classNames from 'classnames';

const DISCORD_URL = 'https://discord.gg/pTge2BwDBq';

export type TLErrorFallbackComponent = ComponentType<{
error: unknown;
refresh: () => void;
editor?: Editor;
}>;

export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor, refresh }) => {
const containerRef = useRef<HTMLDivElement>(null);
const [shouldShowError, setShouldShowError] = useState(process.env.NODE_ENV !== 'production');
const [didCopy, setDidCopy] = useState(false);
Expand Down Expand Up @@ -81,10 +82,6 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
setDidCopy(true);
};

const refresh = () => {
refreshPage();
};

const resetLocalState = async () => {
hardResetEditor();
};
Expand Down Expand Up @@ -152,11 +149,8 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
{shouldShowError ? 'Hide details' : 'Show details'}
</button>
<div className="tl-error-boundary__content__actions__group">
<button className="tl-error-boundary__reset" onClick={() => setShouldShowResetConfirmation(true)}>
Reset data
</button>
<button className="tl-error-boundary__refresh" onClick={refresh}>
Refresh Page
Refresh
</button>
</div>
</div>
Expand Down
19 changes: 17 additions & 2 deletions packages/hms-whiteboard/src/Whiteboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ export interface WhiteboardProps {
transparentCanvas?: boolean;
onMount?: (args: { store?: unknown; editor?: unknown }) => void;
}
export function Whiteboard({ endpoint, token, zoomToContent, transparentCanvas, onMount }: WhiteboardProps) {
export function Whiteboard(props: WhiteboardProps) {
const [key, setKey] = useState(Date.now() + props.token);

return <CollaborativeEditor key={key} refresh={() => setKey(Date.now() + props.token)} {...props} />;
}

function CollaborativeEditor({
endpoint,
token,
zoomToContent,
transparentCanvas,
onMount,
refresh,
}: WhiteboardProps & { refresh: () => void }) {
const [editor, setEditor] = useState<Editor>();
const store = useCollaboration({
endpoint,
Expand All @@ -33,7 +46,9 @@ export function Whiteboard({ endpoint, token, zoomToContent, transparentCanvas,
autoFocus
store={store}
onMount={handleMount}
components={{ ErrorFallback }}
components={{
ErrorFallback: ({ error, editor }) => <ErrorFallback editor={editor} error={error} refresh={refresh} />,
}}
hideUi={editor?.getInstanceState()?.isReadonly}
initialState={editor?.getInstanceState()?.isReadonly ? 'hand' : 'select'}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/package.json

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

4 changes: 2 additions & 2 deletions packages/react-sdk/package.json

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

12 changes: 6 additions & 6 deletions packages/roomkit-react/package.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,21 @@ export const RoleAccordion = ({
<Accordion.Content contentStyles={{ border: '1px solid $border_default', borderTop: 'none' }}>
<FixedSizeList
itemSize={ROW_HEIGHT}
itemData={{ peerList: peersInAccordion, isConnected, isHandRaisedAccordion }}
itemData={{
peerList: isHandRaisedAccordion
? peersInAccordion.sort((a, b) => {
try {
const aHandRaisedAt = JSON.parse(a.metadata || '{}').handRaisedAt;
const bHandRaisedAt = JSON.parse(b.metadata || '{}').handRaisedAt;
return aHandRaisedAt - bHandRaisedAt;
} catch (err) {
return 0;
}
})
: peersInAccordion,
isConnected,
isHandRaisedAccordion,
}}
itemKey={itemKey}
itemCount={peersInAccordion.length}
width={width}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { selectDominantSpeaker, useHMSStore } from '@100mslive/react-sdk';
import { VolumeOneIcon } from '@100mslive/react-icons';
import { Flex, styled, Text, textEllipsis, VerticalDivider } from '../../../';
import { Flex, styled, Text, textEllipsis } from '../../../';
import { useRoomLayout } from '../../provider/roomLayoutProvider';

export const SpeakerTag = () => {
Expand All @@ -14,9 +14,8 @@ export const SpeakerTag = () => {
justify="center"
css={{ flex: '1 1 0', color: '$on_surface_high', '@md': { display: 'none' } }}
>
<VerticalDivider css={{ ml: '$8' }} />
<VolumeOneIcon />
<Text variant="md" css={{ ...textEllipsis(200), ml: '$2' }} title={dominantSpeaker.name}>
<Text variant="sm" css={{ ...textEllipsis(200), ml: '$2' }} title={dominantSpeaker.name}>
{dominantSpeaker.name}
</Text>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export const useMyMetadata = () => {
const toggleHandRaise = useCallback(async () => {
if (isHandRaised) {
await hmsActions.lowerLocalPeerHand();
await update({ handRaisedAt: undefined });
} else {
await hmsActions.raiseLocalPeerHand();
await update({ isBRBOn: false });
await update({ isBRBOn: false, handRaisedAt: Date.now() });
}
}, [isHandRaised]); //eslint-disable-line

Expand Down
4 changes: 2 additions & 2 deletions packages/roomkit-web/package.json

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

6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10112,9 +10112,9 @@ fast-levenshtein@^2.0.6:
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==

fast-loops@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/fast-loops/-/fast-loops-1.1.3.tgz#ce96adb86d07e7bf9b4822ab9c6fac9964981f75"
integrity sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g==
version "1.1.4"
resolved "https://registry.yarnpkg.com/fast-loops/-/fast-loops-1.1.4.tgz#61bc77d518c0af5073a638c6d9d5c7683f069ce2"
integrity sha512-8dbd3XWoKCTms18ize6JmQF1SFnnfj5s0B7rRry22EofgMu7B6LKHVh+XfFqFGsqnbH54xgeO83PzpKI+ODhlg==

fast-shallow-equal@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 8b53bf4

Please sign in to comment.