Skip to content

Commit

Permalink
fixed some lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinteodor committed Oct 24, 2024
1 parent a3c3b34 commit a6105a1
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 33 deletions.
4 changes: 2 additions & 2 deletions react/features/base/media/components/AbstractVideoTrack.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {Component, ReactElement} from 'react';
import React, { Component, ReactElement } from 'react';

import { IStore } from '../../../app/types';
import { trackVideoStarted } from '../../tracks/actions';
Expand All @@ -17,7 +17,7 @@ export interface IProps {
dispatch: IStore['dispatch'];

/**
* iOS component for PiP view.
* IOS component for PiP view.
*/
fallbackView?: ReactElement;

Expand Down
25 changes: 12 additions & 13 deletions react/features/base/media/components/native/Video.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import React, { Component, useEffect, useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import { GestureResponderEvent, ViewStyle } from 'react-native';
import { useSelector } from 'react-redux';

import { MediaStream, RTCPIPView, startIOSPIP, stopIOSPIP } from 'react-native-webrtc';
import { useSelector } from 'react-redux';

import { IReduxState} from '../../../../app/types';
import { IReduxState } from '../../../../app/types';
import Pressable from '../../../react/components/native/Pressable';

Check failure on line 7 in react/features/base/media/components/native/Video.tsx

View workflow job for this annotation

GitHub Actions / Lint

There should be no empty line within import group

import VideoTransform from './VideoTransform';
import styles from './styles';
import logger from '../../logger';

import VideoTransform from './VideoTransform';
import styles from './styles';

/**
* The type of the React {@code Component} props of {@link Video}.
*/
interface IProps {

/**
* iOS component for PiP view.
* IOS component for PiP view.
*/
fallbackView: React.Component;

Expand Down Expand Up @@ -76,10 +75,10 @@ const Video: React.FC<IProps> = ({ fallbackView, mirror, onPlaying, onPress, str
fallbackView,
preferredSize: {
width: 400,
height: 800,
height: 800
},
startAutomatically: true
}
};
const objectFit = zoomEnabled ? 'contain' : 'cover';
const viewRef = useRef();

Expand All @@ -100,12 +99,12 @@ const Video: React.FC<IProps> = ({ fallbackView, mirror, onPlaying, onPress, str
onPlaying?.();
}, []);

useEffect(() => {
useEffect(() => {
if (enableIosPIP) {
logger.warn(`Picture in picture mode on`);
logger.warn('Picture in picture mode on');
startIOSPIP(viewRef);
} else {
logger.warn(`Picture in picture mode off`);
logger.warn('Picture in picture mode off');
stopIOSPIP(viewRef);
}
}, [ enableIosPIP ]);
Expand Down Expand Up @@ -136,7 +135,7 @@ const Video: React.FC<IProps> = ({ fallbackView, mirror, onPlaying, onPress, str
</Pressable>
);

}
};

// @ts-ignore
export default Video;
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,16 @@ class ParticipantView extends Component<IProps> {
}

_renderParticipantAvatar() {

Check failure on line 165 in react/features/base/participants/components/ParticipantView.native.tsx

View workflow job for this annotation

GitHub Actions / Lint

Missing JSDoc comment
const {
avatarSize,
participantId,
} = this.props;
const { avatarSize, participantId } = this.props;

return(
return (
<View style = { styles.avatarContainer as ViewStyle }>
<Avatar
participantId = { participantId }
size = { avatarSize } />
</View>
)

Check failure on line 174 in react/features/base/participants/components/ParticipantView.native.tsx

View workflow job for this annotation

GitHub Actions / Lint

Missing semicolon
}
};

Check failure on line 175 in react/features/base/participants/components/ParticipantView.native.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unnecessary semicolon

/**
* Implements React's {@link Component#render()}.
Expand Down
9 changes: 6 additions & 3 deletions react/features/base/participants/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { getGravatarURL } from '@jitsi/js-utils/avatar';

import { IReduxState, IStore } from '../../app/types';
import { isTrackStreamingStatusActive } from '../../connection-indicator/functions';
import { isStageFilmstripAvailable } from '../../filmstrip/functions';
import { isAddPeopleEnabled, isDialOutEnabled } from '../../invite/functions';
import { toggleShareDialog } from '../../share-room/actions';
Expand All @@ -12,6 +13,7 @@ import { getCurrentConference } from '../conference/functions';
import { ADD_PEOPLE_ENABLED } from '../flags/constants';
import { getFeatureFlag } from '../flags/functions';
import i18next from '../i18n/i18next';
import { shouldRenderVideoTrack } from '../media/functions';
import { MEDIA_TYPE, MediaType, VIDEO_TYPE } from '../media/constants';

Check failure on line 17 in react/features/base/participants/functions.ts

View workflow job for this annotation

GitHub Actions / Lint

`../media/constants` import should occur before import of `../media/functions`
import { toState } from '../redux/functions';
import { getScreenShareTrack, getVideoTrackByParticipant, isLocalTrackMuted } from '../tracks/functions.any';
Expand All @@ -25,8 +27,6 @@ import {
} from './constants';
import { preloadImage } from './preloadImage';
import { FakeParticipant, IJitsiParticipant, IParticipant, ISourceInfo } from './types';
import { shouldRenderVideoTrack } from '../media/functions';
import { isTrackStreamingStatusActive } from '../../connection-indicator/functions';


/**
Expand Down Expand Up @@ -852,5 +852,8 @@ export function shouldRenderParticipantVideo(stateful: IStateful, id: string) {
/* Last, check if the participant is sharing their screen and they are on stage. */
const remoteScreenShares = state['features/video-layout'].remoteScreenShares || [];
const largeVideoParticipantId = state['features/large-video'].participantId;
return participant.id === largeVideoParticipantId && remoteScreenShares.includes(participant.id);
const participantIsInLargeVideoWithScreen
= participant.id === largeVideoParticipantId && remoteScreenShares.includes(participant.id);

return participantIsInLargeVideoWithScreen;
}
5 changes: 2 additions & 3 deletions react/features/mobile/picture-in-picture/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ export function enterPictureInPicture() {
if (Platform.OS === 'ios') {
dispatch({
type: ENABLE_IOS_PIP,
enableIosPIP: !enableIosPIP })
enableIosPIP: !enableIosPIP });
}

if (Platform.OS === 'android') {
if (isPipEnabled(getState())) {
const { PictureInPicture } = NativeModules;
const p
= Platform.OS === 'android'
? PictureInPicture
= Platform.OS === 'android' ? PictureInPicture
? PictureInPicture.enterPictureInPicture()
: Promise.reject(
new Error('Picture-in-Picture not supported'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class PictureInPictureButton extends AbstractButton<IProps> {
* }}
*/
function _mapStateToProps(state: IReduxState) {
const pipEnabled = isPipEnabled(state);
const pipWhileScreenSharingEnabled = getFeatureFlag(state, PIP_WHILE_SCREEN_SHARING_ENABLED, false);
const enabled = pipEnabled && (!isLocalVideoTrackDesktop(state) || pipWhileScreenSharingEnabled);
// const pipEnabled = isPipEnabled(state);
// const pipWhileScreenSharingEnabled = getFeatureFlag(state, PIP_WHILE_SCREEN_SHARING_ENABLED, false);
// const enabled = pipEnabled && (!isLocalVideoTrackDesktop(state) || pipWhileScreenSharingEnabled);

return {
_enabled: true
Expand Down
6 changes: 4 additions & 2 deletions react/features/mobile/picture-in-picture/middleware.native.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import MiddlewareRegistry from '../../base/redux/MiddlewareRegistry';
import { APP_STATE_CHANGED } from '../background/actionTypes';

import { ENABLE_IOS_PIP } from './actionTypes';

MiddlewareRegistry.register(store => next => action => {
Expand All @@ -14,11 +15,12 @@ MiddlewareRegistry.register(store => next => action => {
if (appState === 'inactive') {
dispatch({
type: ENABLE_IOS_PIP,
enableIosPIP: false })
enableIosPIP: false
});
}
break;
}
}

return result;
})
});
4 changes: 3 additions & 1 deletion react/features/mobile/picture-in-picture/reducer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ReducerRegistry from '../../base/redux/ReducerRegistry';

import { ENABLE_IOS_PIP } from './actionTypes';

const DEFAULT_STATE = {
Expand All @@ -11,6 +12,7 @@ export interface IMobilePictureInPictureState {

const STORE_NAME = 'features/mobile/picture-in-picture';

// eslint-disable-next-line max-len
ReducerRegistry.register<IMobilePictureInPictureState>(STORE_NAME, (state = DEFAULT_STATE, action): IMobilePictureInPictureState => {
switch (action.type) {

Expand All @@ -26,4 +28,4 @@ ReducerRegistry.register<IMobilePictureInPictureState>(STORE_NAME, (state = DEFA
default:
return state;
}
})
});

0 comments on commit a6105a1

Please sign in to comment.