Skip to content

Commit 23a8a34

Browse files
authored
Merge pull request #23357 from Pujan92/fix/22613
Fix: Don't truncate long room names in room details page
2 parents e945abb + 529f2d3 commit 23a8a34

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/components/DisplayNames/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ class DisplayNames extends PureComponent {
7878
}
7979

8080
return (
81-
// Tokenization of string only support 1 numberOfLines on Web
81+
// Tokenization of string only support prop numberOfLines on Web
8282
<Text
8383
style={[...this.props.textStyles, styles.pRelative]}
8484
onLayout={this.setContainerLayout}
85-
numberOfLines={1}
85+
numberOfLines={this.props.numberOfLines || undefined}
8686
ref={(el) => (this.containerRef = el)}
8787
>
8888
{this.props.shouldUseFullTitle

src/components/DisplayNames/index.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function DisplayNames(props) {
88
<Text
99
accessibilityLabel={props.accessibilityLabel}
1010
style={props.textStyles}
11-
numberOfLines={props.numberOfLines}
11+
numberOfLines={props.numberOfLines || undefined}
1212
>
1313
{props.fullTitle}
1414
</Text>

src/pages/ReportDetailsPage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function ReportDetailsPage(props) {
6262
const isPolicyAdmin = useMemo(() => PolicyUtils.isPolicyAdmin(policy), [policy]);
6363
const shouldDisableSettings = useMemo(() => ReportUtils.shouldDisableSettings(props.report), [props.report]);
6464
const shouldUseFullTitle = !shouldDisableSettings;
65+
const isChatRoom = useMemo(() => ReportUtils.isChatRoom(props.report), [props.report]);
6566
const isThread = useMemo(() => ReportUtils.isChatThread(props.report), [props.report]);
6667
const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]);
6768
const isArchivedRoom = useMemo(() => ReportUtils.isArchivedRoom(props.report), [props.report]);
@@ -153,8 +154,8 @@ function ReportDetailsPage(props) {
153154
fullTitle={ReportUtils.getReportName(props.report)}
154155
displayNamesWithTooltips={displayNamesWithTooltips}
155156
tooltipEnabled
156-
numberOfLines={1}
157-
textStyles={[styles.textHeadline, styles.textAlignCenter, styles.pre]}
157+
numberOfLines={isChatRoom ? 0 : 1}
158+
textStyles={[styles.textHeadline, styles.textAlignCenter, isChatRoom ? undefined : styles.pre]}
158159
shouldUseFullTitle={shouldUseFullTitle}
159160
/>
160161
</View>

0 commit comments

Comments
 (0)