@@ -17,13 +17,13 @@ import {
17
17
import { Flexbox } from 'react-layout-kit' ;
18
18
19
19
import ActionIcon from '@/ActionIcon' ;
20
- import MobileSafeArea from '@/MobileSafeArea' ;
21
20
22
21
import ChatInputAreaInner , { type ChatInputAreaInnerProps } from '../ChatInputAreaInner' ;
23
22
24
23
const useStyles = createStyles ( ( { css, token } ) => {
25
24
return {
26
25
container : css `
26
+ flex : none;
27
27
padding-block : 12px 12px ;
28
28
background : ${ token . colorFillQuaternary } ;
29
29
border-block-start : 1px solid ${ rgba ( token . colorBorder , 0.25 ) } ;
@@ -51,7 +51,6 @@ const useStyles = createStyles(({ css, token }) => {
51
51
export interface MobileChatInputAreaProps extends ChatInputAreaInnerProps {
52
52
bottomAddons ?: ReactNode ;
53
53
expand ?: boolean ;
54
- safeArea ?: boolean ;
55
54
setExpand ?: ( expand : boolean ) => void ;
56
55
style ?: CSSProperties ;
57
56
textAreaLeftAddons ?: ReactNode ;
@@ -74,7 +73,6 @@ const MobileChatInputArea = forwardRef<TextAreaRef, MobileChatInputAreaProps>(
74
73
onInput,
75
74
loading,
76
75
value,
77
- safeArea,
78
76
} ,
79
77
ref ,
80
78
) => {
@@ -114,51 +112,46 @@ const MobileChatInputArea = forwardRef<TextAreaRef, MobileChatInputAreaProps>(
114
112
const showAddons = ! expand && ! isFocused ;
115
113
116
114
return (
117
- < Flexbox >
115
+ < Flexbox
116
+ className = { cx ( styles . container , expand && styles . expand , className ) }
117
+ gap = { 12 }
118
+ style = { style }
119
+ >
120
+ { topAddons && < Flexbox style = { showAddons ? { } : { display : 'none' } } > { topAddons } </ Flexbox > }
118
121
< Flexbox
119
- className = { cx ( styles . container , expand && styles . expand , className ) }
120
- gap = { 12 }
121
- style = { style }
122
+ className = { cx ( expand && styles . expand ) }
123
+ ref = { containerRef }
124
+ style = { { position : 'relative' } }
122
125
>
123
- { topAddons && (
124
- < Flexbox style = { showAddons ? { } : { display : 'none' } } > { topAddons } </ Flexbox >
125
- ) }
126
- < Flexbox
127
- className = { cx ( expand && styles . expand ) }
128
- ref = { containerRef }
129
- style = { { position : 'relative' } }
130
- >
131
- { showFullscreen && (
132
- < ActionIcon
133
- active
134
- className = { styles . expandButton }
135
- icon = { expand ? ChevronDown : ChevronUp }
136
- onClick = { ( ) => setExpand ?.( ! expand ) }
137
- size = { { blockSize : 24 , borderRadius : '50%' , fontSize : 14 } }
138
- style = { expand ? { top : 6 } : { } }
139
- />
140
- ) }
141
- < InnerContainer >
142
- < ChatInputAreaInner
143
- autoSize = { expand ? false : { maxRows : 6 , minRows : 0 } }
144
- className = { cx ( expand && styles . expandTextArea ) }
145
- loading = { loading }
146
- onBlur = { ( ) => setIsFocused ( false ) }
147
- onFocus = { ( ) => setIsFocused ( true ) }
148
- onInput = { onInput }
149
- onSend = { onSend }
150
- ref = { ref }
151
- style = { { height : 36 , paddingBlock : 6 } }
152
- type = { expand ? 'pure' : 'block' }
153
- value = { value }
154
- />
155
- </ InnerContainer >
156
- </ Flexbox >
157
- { bottomAddons && (
158
- < Flexbox style = { showAddons ? { } : { display : 'none' } } > { bottomAddons } </ Flexbox >
126
+ { showFullscreen && (
127
+ < ActionIcon
128
+ active
129
+ className = { styles . expandButton }
130
+ icon = { expand ? ChevronDown : ChevronUp }
131
+ onClick = { ( ) => setExpand ?.( ! expand ) }
132
+ size = { { blockSize : 24 , borderRadius : '50%' , fontSize : 14 } }
133
+ style = { expand ? { top : 6 } : { } }
134
+ />
159
135
) }
136
+ < InnerContainer >
137
+ < ChatInputAreaInner
138
+ autoSize = { expand ? false : { maxRows : 6 , minRows : 0 } }
139
+ className = { cx ( expand && styles . expandTextArea ) }
140
+ loading = { loading }
141
+ onBlur = { ( ) => setIsFocused ( false ) }
142
+ onFocus = { ( ) => setIsFocused ( true ) }
143
+ onInput = { onInput }
144
+ onSend = { onSend }
145
+ ref = { ref }
146
+ style = { { height : 36 , paddingBlock : 6 } }
147
+ type = { expand ? 'pure' : 'block' }
148
+ value = { value }
149
+ />
150
+ </ InnerContainer >
160
151
</ Flexbox >
161
- { safeArea && ! isFocused && < MobileSafeArea position = { 'bottom' } /> }
152
+ { bottomAddons && (
153
+ < Flexbox style = { showAddons ? { } : { display : 'none' } } > { bottomAddons } </ Flexbox >
154
+ ) }
162
155
</ Flexbox >
163
156
) ;
164
157
} ,
0 commit comments