Skip to content

Commit

Permalink
revert: remove framer motion and nc for ios (#3388)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 authored Nov 28, 2024
1 parent 307632e commit 4818432
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 60 deletions.
3 changes: 1 addition & 2 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
@@ -1,5 +1,4 @@
import React from 'react';
import { AnimatePresence } from 'framer-motion';
import { TrackWithPeerAndDimensions } from '@100mslive/react-sdk';
import { Box } from '../../../Layout';
// @ts-ignore: No implicit Any
Expand All @@ -10,37 +9,35 @@ export const Grid = React.forwardRef<HTMLDivElement, { tiles: TrackWithPeerAndDi
({ tiles, edgeToEdge }, ref) => {
const videoTileProps = useVideoTileContext();
return (
<AnimatePresence>
<Box
ref={ref}
css={{
flex: '1 1 0',
gap: '$4',
display: 'flex',
placeContent: 'center',
alignItems: 'center',
justifyContent: 'center',
flexFlow: 'row wrap',
minHeight: 0,
'@lg': { gap: edgeToEdge ? 0 : '$4' },
}}
>
{tiles?.map(tile => {
return (
<VideoTile
key={tile.track?.id || tile.peer?.id}
width={tile.width}
height={tile.height}
peerId={tile.peer?.id}
trackId={tile.track?.id}
rootCSS={{ padding: 0 }}
objectFit="contain"
{...videoTileProps}
/>
);
})}
</Box>
</AnimatePresence>
<Box
ref={ref}
css={{
flex: '1 1 0',
gap: '$4',
display: 'flex',
placeContent: 'center',
alignItems: 'center',
justifyContent: 'center',
flexFlow: 'row wrap',
minHeight: 0,
'@lg': { gap: edgeToEdge ? 0 : '$4' },
}}
>
{tiles?.map(tile => {
return (
<VideoTile
key={tile.track?.id || tile.peer?.id}
width={tile.width}
height={tile.height}
peerId={tile.peer?.id}
trackId={tile.track?.id}
rootCSS={{ padding: 0 }}
objectFit="contain"
{...videoTileProps}
/>
);
})}
</Box>
);
},
);
17 changes: 2 additions & 15 deletions packages/roomkit-react/src/VideoTile/StyledVideoTile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { motion } from 'framer-motion';
import { Box } from '../Layout';
import { styled } from '../Theme';
import { flexCenter } from '../utils';
Expand All @@ -7,18 +6,6 @@ export const Root = styled('div', {
padding: '0.75rem',
});

const MotionRoot = motion(Root);
MotionRoot.defaultProps = {
layout: true,
transition: {
type: 'spring',
stiffness: 300,
damping: 30,
mass: 1,
duration: 0.15,
},
};

const Container = styled('div', {
width: '100%',
height: '100%',
Expand Down Expand Up @@ -137,7 +124,7 @@ const AvatarContainer = styled(Box, {
});

interface VideoTileType {
Root: typeof MotionRoot;
Root: typeof Root;
Container: typeof Container;
Overlay: typeof Overlay;
Info: typeof Info;
Expand All @@ -148,7 +135,7 @@ interface VideoTileType {
}

export const StyledVideoTile: VideoTileType = {
Root: MotionRoot,
Root,
Container,
Overlay,
Info,
Expand Down
15 changes: 4 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@100mslive/[email protected].2-alpha.7":
version "0.0.2-alpha.7"
resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.2-alpha.7.tgz#049221bf8cac991c2e29594cf92e4022d1a8190b"
integrity sha512-XRhhbGWDWnSnKK6cfSiVaBpRyTleG/ysZr36Vec3WJab26rLBP7B9JTn0kT8MYpbBW+1mmyuPjR7vwI20Qo/vQ==
"@100mslive/[email protected].1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.1.tgz#037c8bdfb6b2d7bf12f9d257422150fe6ca43acb"
integrity sha512-DGnzcXRDJREWypIjGX70er+f2k/XLLRF41lrXPs1+PtB1imdEkECPPS0Fg4BA0BCWKDNAGTZBHZPrBDgUmr9Lw==

"@100mslive/[email protected]":
version "0.12.12"
Expand Down Expand Up @@ -10511,13 +10511,6 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"

framer-motion@^11.11.0:
version "11.11.9"
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-11.11.9.tgz#a60ddf5abbd924812df923068628537a5c6ad8b9"
integrity sha512-XpdZseuCrZehdHGuW22zZt3SF5g6AHJHJi7JwQIigOznW4Jg1n0oGPMJQheMaKLC+0rp5gxUKMRYI6ytd3q4RQ==
dependencies:
tslib "^2.4.0"

[email protected]:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
Expand Down

0 comments on commit 4818432

Please sign in to comment.