-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Subheader update and parent navigation #20484
Changes from 11 commits
5bc78ab
0d49fef
fa4fbfe
09d20d9
6229c31
d342f83
8e4d9c8
c4adb24
8c9f78e
789aa12
154b0a5
72ceeba
745c78e
1ddbd7c
da803e9
ef354e5
f60a544
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ import ThreeDotsMenu from '../../components/ThreeDotsMenu'; | |
import * as Task from '../../libs/actions/Task'; | ||
import reportActionPropTypes from './report/reportActionPropTypes'; | ||
import PinButton from '../../components/PinButton'; | ||
import Navigation from '../../libs/Navigation/Navigation'; | ||
import ROUTES from '../../ROUTES'; | ||
|
||
const propTypes = { | ||
/** Toggles the navigationMenu open and closed */ | ||
|
@@ -78,7 +80,7 @@ const HeaderView = (props) => { | |
const isTaskReport = ReportUtils.isTaskReport(props.report); | ||
const reportHeaderData = (isTaskReport || !isThread) && props.report.parentReportID ? props.parentReport : props.report; | ||
const title = ReportUtils.getReportName(reportHeaderData); | ||
const subtitle = ReportUtils.getChatRoomSubtitle(reportHeaderData, props.parentReport); | ||
const subtitle = ReportUtils.getChatRoomSubtitle(reportHeaderData); | ||
const isConcierge = participants.length === 1 && _.contains(participants, CONST.EMAIL.CONCIERGE); | ||
const isAutomatedExpensifyAccount = participants.length === 1 && ReportUtils.hasAutomatedExpensifyEmails(participants); | ||
const guideCalendarLink = lodashGet(props.account, 'guideCalendarLink'); | ||
|
@@ -171,12 +173,30 @@ const HeaderView = (props) => { | |
shouldUseFullTitle={isChatRoom || isPolicyExpenseChat || isThread || isTaskReport} | ||
/> | ||
{(isChatRoom || isPolicyExpenseChat || isThread) && !_.isEmpty(subtitle) && ( | ||
<Text | ||
style={[styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting, styles.pre]} | ||
numberOfLines={1} | ||
> | ||
{subtitle} | ||
</Text> | ||
<> | ||
{isThread ? ( | ||
<Pressable | ||
onPress={() => { | ||
Navigation.navigate(ROUTES.getReportRoute(props.report.parentReportID)); | ||
}} | ||
> | ||
<Text | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we added this component, the content is stretched and hence clicking the blank space was opening user chat instead of the chat details. This caused a regression here. I think the issue occurred because we copy pasted the Text content, which didn't have the click behavior earlier. |
||
style={[styles.optionAlternateText, styles.textLabelSupporting, styles.link]} | ||
numberOfLines={1} | ||
> | ||
{subtitle} | ||
</Text> | ||
</Pressable> | ||
) : ( | ||
<Text | ||
style={[styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting]} | ||
chiragsalian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
numberOfLines={1} | ||
> | ||
{subtitle} | ||
</Text> | ||
) | ||
} | ||
</> | ||
)} | ||
</View> | ||
{brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this method down since it refers
getDMRootReportName
. The only change to this method is this line and this one.