1- import { ReactNode , RefObject } from 'react' ;
2- import {
3- FlatList ,
4- StyleProp ,
5- TouchableOpacity ,
6- View ,
7- ViewStyle ,
8- } from 'react-native' ;
1+ import React , { ReactNode , RefObject } from 'react' ;
2+ import { FlatList , StyleProp , View , ViewStyle } from 'react-native' ;
93import { IMessage } from 'react-native-gifted-chat' ;
4+ import { RightSection } from './RightSection' ;
5+ import { MiddleSection } from './MiddleSection' ;
6+ import { LeftSection } from './LeftSection' ;
107
118export const ChatFooter = ( props : {
129 newMessagesBannerComponent ?: ( ) => ReactNode ;
@@ -28,48 +25,26 @@ export const ChatFooter = (props: {
2825 position : 'absolute' ,
2926 flexDirection : 'row' ,
3027 justifyContent : 'flex-start' ,
31- backgroundColor : 'rgba(255, 255, 255, 0.8)' ,
3228 width : '100%' ,
33- height : 100 ,
34- bottom : 0 ,
29+ bottom : 40 ,
3530 left : 0 ,
3631 } }
3732 >
38- < View style = { { display : 'flex' , flex : 1 } } > </ View >
39- < View style = { { display : 'flex' , flex : 1 } } >
40- { ! props . closeToTop && props . newMessagesBannerComponent && (
41- < TouchableOpacity
42- onPress = { scrollToBottom }
43- style = {
44- props . newMessagesBannerStyles ?? {
45- alignSelf : 'center' ,
46- backgroundColor : 'rgba(255, 255, 255, 0.8)' ,
47- padding : 10 ,
48- borderRadius : 100 ,
49- }
50- }
51- >
52- { props . newMessagesBannerComponent ( ) }
53- </ TouchableOpacity >
54- ) }
55- </ View >
56- < View style = { { display : 'flex' , flex : 1 } } >
57- { ! props . closeToTop && props . scrollToBottomComponent && (
58- < TouchableOpacity
59- onPress = { scrollToBottom }
60- style = {
61- props . scrollToBottomStyle ?? {
62- alignSelf : 'flex-end' ,
63- backgroundColor : 'rgba(255, 255, 255, 0.8)' ,
64- padding : 10 ,
65- borderRadius : 100 ,
66- }
67- }
68- >
69- { props . scrollToBottomComponent ( ) }
70- </ TouchableOpacity >
71- ) }
72- </ View >
33+ < LeftSection />
34+
35+ < MiddleSection
36+ newMessagesBannerComponent = { props . newMessagesBannerComponent }
37+ newMessagesBannerStyles = { props . newMessagesBannerStyles }
38+ onNewMessagesBannerPress = { scrollToBottom }
39+ closeToTop = { props . closeToTop }
40+ />
41+
42+ < RightSection
43+ scrollToBottom = { scrollToBottom }
44+ scrollToBottomComponent = { props . scrollToBottomComponent }
45+ scrollToBottomStyle = { props . scrollToBottomStyle }
46+ closeToTop = { props . closeToTop }
47+ />
7348 </ View >
7449 ) ;
7550} ;
0 commit comments