Skip to content

Commit

Permalink
feat: transparent canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
eswarclynn committed Apr 8, 2024
1 parent 129f440 commit 674c69a
Showing 1 changed file with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useMemo } from 'react';
import React, { useEffect, useMemo } from 'react';
import { useMedia } from 'react-use';
import { Whiteboard, WhiteboardProps } from '@100mslive/hms-whiteboard';
import { Whiteboard } from '@100mslive/hms-whiteboard';
import { selectPeerByCondition, selectWhiteboard, useHMSStore, useWhiteboard } from '@100mslive/react-sdk';
import { Box } from '../../../Layout';
import { config as cssConfig } from '../../../Theme';
Expand All @@ -19,20 +19,6 @@ const WhiteboardEmbed = () => {
const isMobile = useMedia(cssConfig.media.md);
const { token, endpoint, zoomToContent } = useWhiteboard(isMobile);

const handleMount = useCallback<NonNullable<WhiteboardProps['onMount']>>(({ store, editor }) => {
console.log(store, editor);
store?.listen(({ changes }) => {
Object.keys(changes.updated).forEach(key => {
// Only update the current page id from the instance changes, ignore pointer changes
if (!key.includes('instance')) {
return;
}
const newPage = editor?.currentPage;
console.log('page', newPage?.id, newPage?.name);
});
});
}, []);

return (
<Box
css={{
Expand All @@ -46,12 +32,7 @@ const WhiteboardEmbed = () => {
}}
>
<Box css={{ size: '100%' }}>
<Whiteboard
onMount={handleMount}
token={token}
endpoint={`https://${endpoint}`}
zoomToContent={zoomToContent}
/>
<Whiteboard token={token} endpoint={`https://${endpoint}`} zoomToContent={zoomToContent} />
</Box>
</Box>
);
Expand Down

0 comments on commit 674c69a

Please sign in to comment.