Skip to content

Fix: Don't truncate long room names in room details page #23357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/DisplayNames/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class DisplayNames extends PureComponent {
}

return (
// Tokenization of string only support 1 numberOfLines on Web
// Tokenization of string only support prop numberOfLines on Web
<Text
style={[...this.props.textStyles, styles.pRelative]}
onLayout={this.setContainerLayout}
numberOfLines={1}
numberOfLines={this.props.numberOfLines || undefined}
ref={(el) => (this.containerRef = el)}
>
{this.props.shouldUseFullTitle
Expand Down
2 changes: 1 addition & 1 deletion src/components/DisplayNames/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function DisplayNames(props) {
<Text
accessibilityLabel={props.accessibilityLabel}
style={props.textStyles}
numberOfLines={props.numberOfLines}
numberOfLines={props.numberOfLines || undefined}
>
{props.fullTitle}
</Text>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function ReportDetailsPage(props) {
const isPolicyAdmin = useMemo(() => PolicyUtils.isPolicyAdmin(policy), [policy]);
const shouldDisableSettings = useMemo(() => ReportUtils.shouldDisableSettings(props.report), [props.report]);
const shouldUseFullTitle = !shouldDisableSettings;
const isChatRoom = useMemo(() => ReportUtils.isChatRoom(props.report), [props.report]);
const isThread = useMemo(() => ReportUtils.isChatThread(props.report), [props.report]);
const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]);
const isArchivedRoom = useMemo(() => ReportUtils.isArchivedRoom(props.report), [props.report]);
Expand Down Expand Up @@ -153,8 +154,8 @@ function ReportDetailsPage(props) {
fullTitle={ReportUtils.getReportName(props.report)}
displayNamesWithTooltips={displayNamesWithTooltips}
tooltipEnabled
numberOfLines={1}
textStyles={[styles.textHeadline, styles.textAlignCenter, styles.pre]}
numberOfLines={isChatRoom ? 0 : 1}
textStyles={[styles.textHeadline, styles.textAlignCenter, isChatRoom ? undefined : styles.pre]}
shouldUseFullTitle={shouldUseFullTitle}
/>
</View>
Expand Down