Skip to content

Commit

Permalink
fix: [IOCOM-1955] Fix message time going out of screen (#6459)
Browse files Browse the repository at this point in the history
## Short description
This PR fixes a regression in the MessageListItem that made the
message's received date going out of screen.
|Before|After|
|-|-|
|![Screenshot 2024-11-25 (07 34
49)](https://github.com/user-attachments/assets/1f6c135c-62cc-4bdd-b7df-917af29b4562)|![Screenshot_1732612114](https://github.com/user-attachments/assets/477a1127-c43b-4754-8e48-1334317117b3)|

## List of changes proposed in this pull request
- `flex: 1` was replaced with `flexGrow: 1` (in order to have a more
website-driven styling approach) but this caused the problem described
above. Combining it with `flexShrink: 1` results in having the save
behaviour as `flex: 1`

## How to test
check that the message list is displayed properly, with the date staying
inside the cell.
  • Loading branch information
Vangaorth authored Nov 26, 2024
1 parent 11167cb commit 113d171
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ts/features/messages/components/Home/DS/MessageListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,14 @@ export const MessageListItem = ({
</View>
<View style={styles.textContainer}>
<View style={styles.organizationContainer}>
{/* We use 'flexGrow: 1, flexShrink: 1' instead of 'flex: 1'
in order to keep a consistent styling approach between
react and react-native (on react-native, 'flex: 1' does
something similar to 'flex-grow') */}
<H6
numberOfLines={1}
color={theme["textBody-default"]}
style={{ flexGrow: 1 }}
style={{ flexGrow: 1, flexShrink: 1 }}
>
{organizationName}
</H6>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ exports[`WrappedMessageListItem should match snapshot, from SEND, read message 1
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -1560,6 +1561,7 @@ exports[`WrappedMessageListItem should match snapshot, from SEND, unread message
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -2684,6 +2686,7 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains p
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -3663,6 +3666,7 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains p
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -4697,6 +4701,7 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains u
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -5547,6 +5552,7 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, contains u
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -6331,6 +6337,7 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, not a paym
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down Expand Up @@ -7060,6 +7067,7 @@ exports[`WrappedMessageListItem should match snapshot, not from SEND, not a paym
},
{
"flexGrow": 1,
"flexShrink": 1,
},
]
}
Expand Down

0 comments on commit 113d171

Please sign in to comment.