[FIX] Avatar's size on display mode change (#4042)
* fix: avatar's size * update snapshot * update: snapshots Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com>
This commit is contained in:
parent
8012031cd3
commit
aab4e4b12a
|
@ -32,7 +32,7 @@ class AvatarContainer extends React.Component<IAvatar, any> {
|
|||
|
||||
shouldComponentUpdate(nextProps: IAvatar, nextState: { avatarETag: string }) {
|
||||
const { avatarETag } = this.state;
|
||||
const { text, type, externalProviderUrl } = this.props;
|
||||
const { text, type, size, externalProviderUrl } = this.props;
|
||||
if (nextProps.externalProviderUrl !== externalProviderUrl) {
|
||||
return true;
|
||||
}
|
||||
|
@ -45,6 +45,10 @@ class AvatarContainer extends React.Component<IAvatar, any> {
|
|||
if (nextProps.type !== type) {
|
||||
return true;
|
||||
}
|
||||
if (nextProps.size !== size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ export const LeftActions = React.memo(({ theme, transX, isRead, width, onToggleR
|
|||
const viewHeight = isCondensed ? { height: ROW_HEIGHT_CONDENSED } : null;
|
||||
|
||||
return (
|
||||
<View style={[styles.actionsContainer, styles.actionLeftContainer]} pointerEvents='box-none'>
|
||||
<View style={[styles.actionsContainer, styles.actionsLeftContainer]} pointerEvents='box-none'>
|
||||
<Animated.View
|
||||
style={[
|
||||
styles.actionLeftButtonContainer,
|
||||
|
|
|
@ -23,7 +23,6 @@ interface IRoomItem {
|
|||
avatar: string;
|
||||
showLastMessage: boolean;
|
||||
username: string;
|
||||
avatarSize: number;
|
||||
testID: string;
|
||||
width: number;
|
||||
status: TUserStatus;
|
||||
|
@ -59,7 +58,6 @@ interface IRoomItem {
|
|||
onLongPress(): void;
|
||||
hideChannel(): void;
|
||||
autoJoin: boolean;
|
||||
size?: number;
|
||||
showAvatar: boolean;
|
||||
displayMode: string;
|
||||
sourceType: IOmnichannelSource;
|
||||
|
@ -72,7 +70,6 @@ const RoomItem = ({
|
|||
name,
|
||||
avatar,
|
||||
width,
|
||||
avatarSize = 48,
|
||||
username,
|
||||
showLastMessage,
|
||||
status = 'offline',
|
||||
|
@ -125,7 +122,6 @@ const RoomItem = ({
|
|||
<Wrapper
|
||||
accessibilityLabel={accessibilityLabel}
|
||||
avatar={avatar}
|
||||
avatarSize={avatarSize}
|
||||
type={type}
|
||||
theme={theme}
|
||||
rid={rid}
|
||||
|
|
|
@ -10,7 +10,6 @@ import styles from './styles';
|
|||
interface IWrapper {
|
||||
accessibilityLabel: string;
|
||||
avatar: string;
|
||||
avatarSize: number;
|
||||
type: string;
|
||||
theme: TSupportedThemes;
|
||||
rid: string;
|
||||
|
|
|
@ -16,7 +16,6 @@ interface IRoomItemContainerProps {
|
|||
onPress: Function;
|
||||
onLongPress: Function;
|
||||
username: string;
|
||||
avatarSize: number;
|
||||
width: number;
|
||||
status: TUserStatus;
|
||||
toggleFav(): void;
|
||||
|
@ -56,7 +55,6 @@ class RoomItemContainer extends React.Component<IRoomItemContainerProps, any> {
|
|||
private roomSubscription: any;
|
||||
|
||||
static defaultProps: Partial<IRoomItemContainerProps> = {
|
||||
avatarSize: 48,
|
||||
status: 'offline',
|
||||
getUserPresence: () => {},
|
||||
getRoomTitle: () => 'title',
|
||||
|
@ -145,7 +143,6 @@ class RoomItemContainer extends React.Component<IRoomItemContainerProps, any> {
|
|||
hideChannel,
|
||||
theme,
|
||||
isFocused,
|
||||
avatarSize,
|
||||
status,
|
||||
showLastMessage,
|
||||
username,
|
||||
|
@ -198,7 +195,6 @@ class RoomItemContainer extends React.Component<IRoomItemContainerProps, any> {
|
|||
type={item.t}
|
||||
theme={theme}
|
||||
isFocused={isFocused}
|
||||
size={avatarSize}
|
||||
prid={item.prid}
|
||||
status={status}
|
||||
hideUnreadStatus={item.hideUnreadStatus}
|
||||
|
|
|
@ -8,7 +8,7 @@ export const ACTION_WIDTH = 80;
|
|||
export const SMALL_SWIPE = ACTION_WIDTH / 2;
|
||||
export const LONG_SWIPE = ACTION_WIDTH * 3;
|
||||
|
||||
export default StyleSheet.create<any>({
|
||||
export default StyleSheet.create({
|
||||
flex: {
|
||||
flex: 1
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue