forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
562d7b4
commit 531033a
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Avatar from '@components/Avatar'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; | ||
import * as UserUtils from '@libs/UserUtils'; | ||
import CONST from '@src/CONST'; | ||
import ProfileAvatarWithIndicator from './ProfileAvatarWithIndicator'; | ||
|
||
type AvatarWithDelegateAvatarProps = { | ||
/** Emoji status */ | ||
delegateEmail: string; | ||
|
||
/** Whether the avatar is selected */ | ||
isSelected?: boolean; | ||
}; | ||
|
||
function AvatarWithDelegateAvatar({delegateEmail, isSelected = false}: AvatarWithDelegateAvatarProps) { | ||
const styles = useThemeStyles(); | ||
const personalDetail = PersonalDetailsUtils.getPersonalDetailByEmail(delegateEmail); | ||
|
||
return ( | ||
<View style={styles.sidebarStatusAvatarContainer}> | ||
<ProfileAvatarWithIndicator isSelected={isSelected} /> | ||
<View style={[styles.sidebarStatusAvatar]}> | ||
<View style={styles.emojiStatusLHN}> | ||
<Avatar | ||
size={CONST.AVATAR_SIZE.SMALL} | ||
source={UserUtils.getSmallSizeAvatar(personalDetail?.avatar, personalDetail?.accountID)} | ||
fallbackIcon={personalDetail?.fallbackIcon} | ||
type={CONST.ICON_TYPE_AVATAR} | ||
/> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
AvatarWithDelegateAvatar.displayName = 'AvatarWithDelegateAvatar'; | ||
|
||
export default AvatarWithDelegateAvatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters