Skip to content
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

Fix: Composer top padding collapsed in room after scroll up #23992

Merged
merged 10 commits into from
Aug 3, 2023
14 changes: 4 additions & 10 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ReportActionItem from './ReportActionItem';
import ReportActionItemParentAction from './ReportActionItemParentAction';
import ReportActionsSkeletonView from '../../../components/ReportActionsSkeletonView';
import variables from '../../../styles/variables';
import participantPropTypes from '../../../components/participantPropTypes';
import * as ReportActionsUtils from '../../../libs/ReportActionsUtils';
import reportActionPropTypes from './reportActionPropTypes';
import CONST from '../../../CONST';
Expand All @@ -27,9 +26,6 @@ const propTypes = {
/** Position of the "New" line marker */
newMarkerReportActionID: PropTypes.string,

/** Personal details of all the users */
personalDetailsList: PropTypes.objectOf(participantPropTypes),

/** The report currently being looked at */
report: reportPropTypes.isRequired,

Expand Down Expand Up @@ -162,21 +158,19 @@ function ReportActionsList(props) {
// Native mobile does not render updates flatlist the changes even though component did update called.
// To notify there something changes we can use extraData prop to flatlist
const extraData = [props.isSmallScreenWidth ? props.newMarkerReportActionID : undefined, ReportUtils.isArchivedRoom(props.report)];
const shouldShowReportRecipientLocalTime = ReportUtils.canShowReportRecipientLocalTime(props.personalDetailsList, props.report, props.currentUserPersonalDetails.accountID);

const errors = lodashGet(props.report, 'errorFields.addWorkspaceRoom') || lodashGet(props.report, 'errorFields.createChat');
const isArchivedRoom = ReportUtils.isArchivedRoom(props.report);
const hideComposer = ReportUtils.shouldHideComposer(props.report, errors);
const shouldOmitBottomSpace = hideComposer || isArchivedRoom;
const shouldShowReportRecipientLocalTime =
ReportUtils.canShowReportRecipientLocalTime(props.personalDetails, props.report, props.currentUserPersonalDetails.accountID) && !props.isComposerFullSize;

return (
<Animated.View style={[animatedStyles, styles.flex1]}>
<Animated.View style={[animatedStyles, styles.flex1, !shouldShowReportRecipientLocalTime && !hideComposer ? styles.pb4 : {}]}>
<InvertedFlatList
accessibilityLabel={props.translate('sidebarScreen.listOfChatMessages')}
ref={reportScrollManager.ref}
data={props.sortedReportActions}
renderItem={renderItem}
contentContainerStyle={[styles.chatContentScrollView, shouldShowReportRecipientLocalTime || shouldOmitBottomSpace ? styles.pt0 : {}]}
contentContainerStyle={styles.chatContentScrollView}
keyExtractor={keyExtractor}
initialRowHeight={32}
initialNumToRender={calculateInitialNumToRender()}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function ReportFooter(props) {
return (
<>
{hideComposer && (
<View style={[styles.chatFooter, props.isSmallScreenWidth ? styles.mb5 : null]}>
<View style={[styles.chatFooter, isArchivedRoom || isAnonymousUser ? styles.mt4 : {}, props.isSmallScreenWidth ? styles.mb5 : null]}>
{isAnonymousUser && !isArchivedRoom && (
<AnonymousReportFooter
report={props.report}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ const styles = {
chatContentScrollView: {
flexGrow: 1,
justifyContent: 'flex-start',
paddingVertical: 16,
paddingBottom: 16,
},

// Chat Item
Expand Down
Loading