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

Revert "fix composer hidden while loading messages" #13482

Merged
merged 1 commit into from
Dec 9, 2022
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
20 changes: 4 additions & 16 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,7 @@ class ReportScreen extends React.Component {
placeholder={(
<>
<ReportHeaderSkeletonView animate={animatePlaceholder} />
<View style={[styles.flex1, styles.justifyContentEnd, styles.overflowHidden]}>
<ReportActionsSkeletonView animate={animatePlaceholder} containerHeight={this.state.skeletonViewContainerHeight} />
<ReportFooter
shouldDisableCompose
isOffline={this.props.network.isOffline}
/>
</View>
<ReportActionsSkeletonView animate={animatePlaceholder} containerHeight={this.state.skeletonViewContainerHeight} />
</>
)}
>
Expand Down Expand Up @@ -318,15 +312,9 @@ class ReportScreen extends React.Component {
{/* Note: The report should be allowed to mount even if the initial report actions are not loaded. If we prevent rendering the report while they are loading then
we'll unnecessarily unmount the ReportActionsView which will clear the new marker lines initial state. */}
{(!this.isReportReadyForDisplay() || isLoadingInitialReportActions) && (
<>
<ReportActionsSkeletonView
containerHeight={this.state.skeletonViewContainerHeight}
/>
<ReportFooter
shouldDisableCompose
isOffline={this.props.network.isOffline}
/>
</>
<ReportActionsSkeletonView
containerHeight={this.state.skeletonViewContainerHeight}
/>
)}
<PortalHost name={CONST.REPORT.DROP_HOST_NAME} />
</View>
Expand Down
17 changes: 7 additions & 10 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ const propTypes = {
isFocused: PropTypes.bool.isRequired,

/** Is the composer full size */
isComposerFullSize: PropTypes.bool,

/** Whether user interactions should be disabled */
disabled: PropTypes.bool,
isComposerFullSize: PropTypes.bool.isRequired,

// The NVP describing a user's block status
blockedFromConcierge: PropTypes.shape({
Expand Down Expand Up @@ -575,7 +572,7 @@ class ReportActionCompose extends React.Component {
onMouseDown={e => e.preventDefault()}
style={styles.composerSizeButton}
underlayColor={themeColors.componentBG}
disabled={isBlockedFromConcierge || this.props.disabled}
disabled={isBlockedFromConcierge}
>
<Icon src={Expensicons.Collapse} />
</TouchableOpacity>
Expand All @@ -594,7 +591,7 @@ class ReportActionCompose extends React.Component {
onMouseDown={e => e.preventDefault()}
style={styles.composerSizeButton}
underlayColor={themeColors.componentBG}
disabled={isBlockedFromConcierge || this.props.disabled}
disabled={isBlockedFromConcierge}
>
<Icon src={Expensicons.Expand} />
</TouchableOpacity>
Expand All @@ -612,7 +609,7 @@ class ReportActionCompose extends React.Component {
}}
style={styles.chatItemAttachButton}
underlayColor={themeColors.componentBG}
disabled={isBlockedFromConcierge || this.props.disabled}
disabled={isBlockedFromConcierge}
>
<Icon src={Expensicons.Plus} />
</TouchableOpacity>
Expand Down Expand Up @@ -675,7 +672,7 @@ class ReportActionCompose extends React.Component {
onPasteFile={displayFileInModal}
shouldClear={this.state.textInputShouldClear}
onClear={() => this.setTextInputShouldClear(false)}
isDisabled={isComposeDisabled || isBlockedFromConcierge || this.props.disabled}
isDisabled={isComposeDisabled || isBlockedFromConcierge}
selection={this.state.selection}
onSelectionChange={this.onSelectionChange}
isFullComposerAvailable={this.state.isFullComposerAvailable}
Expand All @@ -690,7 +687,7 @@ class ReportActionCompose extends React.Component {
</AttachmentModal>
{canUseTouchScreen() && this.props.isMediumScreenWidth ? null : (
<EmojiPickerButton
isDisabled={isBlockedFromConcierge || this.props.disabled}
isDisabled={isBlockedFromConcierge}
onModalHide={() => this.focus(true)}
onEmojiSelected={this.addEmojiToTextBox}
/>
Expand All @@ -707,7 +704,7 @@ class ReportActionCompose extends React.Component {
// Keep focus on the composer when Send message is clicked.
// eslint-disable-next-line react/jsx-props-no-multi-spaces
onMouseDown={e => e.preventDefault()}
disabled={this.state.isCommentEmpty || isBlockedFromConcierge || this.props.disabled || hasExceededMaxCommentLength}
disabled={this.state.isCommentEmpty || isBlockedFromConcierge || hasExceededMaxCommentLength}
hitSlop={{
top: 3, right: 3, bottom: 3, left: 3,
}}
Expand Down
16 changes: 4 additions & 12 deletions src/pages/home/report/ReportFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ import reportPropTypes from '../../reportPropTypes';

const propTypes = {
/** Report object for the current report */
report: reportPropTypes,
report: reportPropTypes.isRequired,

/** Report actions for the current report */
reportActions: PropTypes.objectOf(PropTypes.shape(reportActionPropTypes)),
reportActions: PropTypes.objectOf(PropTypes.shape(reportActionPropTypes)).isRequired,

/** Offline status */
isOffline: PropTypes.bool.isRequired,

/** Callback fired when the comment is submitted */
onSubmitComment: PropTypes.func,
onSubmitComment: PropTypes.func.isRequired,

/** Any errors associated with an attempt to create a chat */
// eslint-disable-next-line react/forbid-prop-types
Expand All @@ -42,20 +42,13 @@ const propTypes = {
/** Whether the composer input should be shown */
shouldShowComposeInput: PropTypes.bool,

/** Whether user interactions should be disabled */
shouldDisableCompose: PropTypes.bool,

...windowDimensionsPropTypes,
};

const defaultProps = {
report: {reportID: '0'},
reportActions: {},
onSubmitComment: () => {},
shouldShowComposeInput: true,
errors: {},
pendingAction: null,
shouldShowComposeInput: true,
shouldDisableCompose: false,
};

class ReportFooter extends React.Component {
Expand Down Expand Up @@ -106,7 +99,6 @@ class ReportFooter extends React.Component {
reportActions={this.props.reportActions}
report={this.props.report}
isComposerFullSize={this.props.isComposerFullSize}
disabled={this.props.shouldDisableCompose}
/>
</OfflineWithFeedback>
</SwipeableView>
Expand Down