@@ -33,6 +33,7 @@ import {isLoadingInitialReportActionsSelector} from '@src/selectors/ReportMetaDa
3333import type * as OnyxTypes from '@src/types/onyx' ;
3434import ReportActionCompose from './ReportActionCompose/ReportActionCompose' ;
3535import SystemChatReportFooterMessage from './SystemChatReportFooterMessage' ;
36+ import useShouldShowComposerForActiveEditDraft from './useShouldShowComposerForActiveEditDraft' ;
3637
3738const policyRoleSelector = ( policy : OnyxEntry < OnyxTypes . Policy > ) => policy ?. role ;
3839
@@ -77,6 +78,7 @@ function ReportFooter() {
7778 const canWriteInReport = canWriteInReportUtil ( report ) ;
7879 const isSystemChat = isSystemChatUtil ( report ) ;
7980 const isAdminsOnlyPostingRoom = isAdminsOnlyPostingRoomUtil ( report ) ;
81+ const shouldShowComposerForActiveEditDraft = useShouldShowComposerForActiveEditDraft ( ) ;
8082
8183 if ( ! isCurrentReportLoadedFromOnyx || ! report || ! reportIDFromRoute ) {
8284 return null ;
@@ -88,9 +90,7 @@ function ReportFooter() {
8890 if ( ! shouldHideComposer ) {
8991 return (
9092 < View style = { [ chatFooterStyles , isComposerFullSize && styles . chatFooterFullCompose ] } >
91- < SwipeableView onSwipeDown = { Keyboard . dismiss } >
92- < ReportActionCompose reportID = { reportIDFromRoute } />
93- </ SwipeableView >
93+ < ComposerSwipeable reportID = { reportIDFromRoute } />
9494 </ View >
9595 ) ;
9696 }
@@ -151,12 +151,22 @@ function ReportFooter() {
151151 ) ;
152152 }
153153
154- // Admins-only room
154+ // Admins-only room — keep the banner visible; mount the composer above it while editing on narrow screens.
155155 if ( isAdminsOnlyPostingRoom && ! isUserPolicyAdmin ) {
156+ const isEditingWithComposer = shouldShowComposerForActiveEditDraft ;
157+
156158 return (
157- < View style = { [ styles . chatFooter , styles . mt4 , shouldUseNarrowLayout && styles . mb5 ] } >
159+ < View style = { [ styles . chatFooter , ! isEditingWithComposer && styles . mt4 , shouldUseNarrowLayout && styles . mb5 ] } >
160+ { isEditingWithComposer && (
161+ < View style = { [ isComposerFullSize ? styles . chatFooterFullCompose : undefined , styles . mb2 ] } >
162+ < ComposerSwipeable
163+ reportID = { reportIDFromRoute }
164+ isEditOnly
165+ />
166+ </ View >
167+ ) }
158168 < Banner
159- containerStyles = { [ styles . chatFooterBanner ] }
169+ containerStyles = { [ styles . chatFooterBanner , isEditingWithComposer && styles . mt2 ] }
160170 text = { translate ( 'adminOnlyCanPost' ) }
161171 icon = { expensifyIcons . Lightbulb }
162172 shouldShowIcon
@@ -197,4 +207,15 @@ function ReportFooter() {
197207 return null ;
198208}
199209
210+ function ComposerSwipeable ( { reportID, isEditOnly = false } : { reportID : string ; isEditOnly ?: boolean } ) {
211+ return (
212+ < SwipeableView onSwipeDown = { Keyboard . dismiss } >
213+ < ReportActionCompose
214+ reportID = { reportID }
215+ isEditOnly = { isEditOnly }
216+ />
217+ </ SwipeableView >
218+ ) ;
219+ }
220+
200221export default ReportFooter ;
0 commit comments