Skip to content

Commit

Permalink
fix(aot) remove dependency to store (#13910)
Browse files Browse the repository at this point in the history
  • Loading branch information
horymury authored Oct 5, 2023
1 parent 50b0649 commit b4d12d7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions react/features/always-on-top/AlwaysOnTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { Component } from 'react';
// in this environment (e.g. JitsiMeetJS or interfaceConfig)
import StatelessAvatar from '../base/avatar/components/web/StatelessAvatar';
import { getAvatarColor, getInitials } from '../base/avatar/functions';
import { DEFAULT_ICON } from '../base/icons/svg/constants';

import Toolbar from './Toolbar';

Expand Down Expand Up @@ -184,6 +185,7 @@ export default class AlwaysOnTop extends Component<any, IState> {
<div id = 'avatarContainer'>
<StatelessAvatar
color = { getAvatarColor(displayName, customAvatarBackgrounds) }
iconUser = { DEFAULT_ICON.IconUser }
id = 'avatar'
initials = { getInitials(displayName) }
url = { avatarURL } />)
Expand Down
6 changes: 6 additions & 0 deletions react/features/base/avatar/components/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
import { connect } from 'react-redux';

import { IReduxState } from '../../../app/types';
import { IconUser } from '../../icons/svg';
import { getParticipantById } from '../../participants/functions';
import { IParticipant } from '../../participants/types';
import { getAvatarColor, getInitials, isCORSAvatarURL } from '../functions';
Expand Down Expand Up @@ -182,6 +183,7 @@ class Avatar<P extends IProps> extends PureComponent<P, IState> {

const avatarProps: AbstractProps & {
className?: string;
iconUser?: any;
id?: string;
status?: string;
testId?: string;
Expand Down Expand Up @@ -226,6 +228,10 @@ class Avatar<P extends IProps> extends PureComponent<P, IState> {
avatarProps.initials = initials;
}

if (navigator.product !== 'ReactNative') {
avatarProps.iconUser = IconUser;
}

return (
<StatelessAvatar
{ ...avatarProps } />
Expand Down
4 changes: 2 additions & 2 deletions react/features/base/avatar/components/web/StatelessAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useCallback } from 'react';
import { makeStyles } from 'tss-react/mui';

import Icon from '../../../icons/components/Icon';
import { IconUser } from '../../../icons/svg';
import { withPixelLineHeight } from '../../../styles/functions.web';
import { isIcon } from '../../functions';
import { IAvatarProps } from '../../types';
Expand Down Expand Up @@ -122,6 +121,7 @@ const useStyles = makeStyles()(theme => {
const StatelessAvatar = ({
className,
color,
iconUser,
id,
initials,
onAvatarLoadError,
Expand Down Expand Up @@ -212,7 +212,7 @@ const StatelessAvatar = ({
style = { _getAvatarStyle() }>
<Icon
size = { '50%' }
src = { IconUser } />
src = { iconUser } />
</div>
);
};
Expand Down
5 changes: 5 additions & 0 deletions react/features/base/avatar/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export interface IAvatarProps {
*/
color?: string;

/**
* The user icon(browser only).
*/
iconUser?: any;

/**
* Initials to be used to render the initials based avatars.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import Avatar from '../../../base/avatar/components/Avatar';
import StatelessAvatar from '../../../base/avatar/components/web/StatelessAvatar';
import { getInitials } from '../../../base/avatar/functions';
import { IconUser } from '../../../base/icons/svg';
import BaseTheme from '../../../base/ui/components/BaseTheme.web';
import { FaceLandmarks } from '../../../face-landmarks/types';

Expand Down Expand Up @@ -78,6 +79,7 @@ const SpeakerStatsItem = (props: IProps) => {
<StatelessAvatar
className = 'userAvatar'
color = { BaseTheme.palette.ui04 }
iconUser = { IconUser }
initials = { getInitials(props.displayName) }
size = { 32 } />
) : (
Expand Down

0 comments on commit b4d12d7

Please sign in to comment.