Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3347962
D14007.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14007.id.diff
View Options
diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js
--- a/native/chat/chat-input-bar.react.js
+++ b/native/chat/chat-input-bar.react.js
@@ -313,9 +313,10 @@
+setText: (text: string) => void,
+textEdited: boolean,
+setTextEdited: (edited: boolean) => void,
+ +buttonsExpanded: boolean,
+ +setButtonsExpanded: (expanded: boolean) => void,
};
type State = {
- +buttonsExpanded: boolean,
+isExitingDuringEditMode: boolean,
};
class ChatInputBar extends React.PureComponent<Props, State> {
@@ -341,7 +342,6 @@
constructor(props: Props) {
super(props);
this.state = {
- buttonsExpanded: true,
isExitingDuringEditMode: false,
};
@@ -801,7 +801,7 @@
<View style={this.props.styles.inputContainer}>
<AnimatedView style={this.expandoButtonsStyle}>
<View style={expandoButtonsViewStyle}>
- {this.state.buttonsExpanded ? expandoButton : null}
+ {this.props.buttonsExpanded ? expandoButton : null}
<TouchableOpacity
onPress={this.showMediaGallery}
activeOpacity={0.4}
@@ -817,7 +817,7 @@
<TouchableOpacity
onPress={this.props.openCamera}
activeOpacity={0.4}
- disabled={!this.state.buttonsExpanded}
+ disabled={!this.props.buttonsExpanded}
>
<AnimatedView style={this.cameraIconStyle}>
<SWMansionIcon
@@ -827,7 +827,7 @@
/>
</AnimatedView>
</TouchableOpacity>
- {this.state.buttonsExpanded ? null : expandoButton}
+ {this.props.buttonsExpanded ? null : expandoButton}
</View>
</AnimatedView>
<SelectableTextInput
@@ -1168,29 +1168,29 @@
}
expandButtons = () => {
- if (this.state.buttonsExpanded || this.isEditMode()) {
+ if (this.props.buttonsExpanded || this.isEditMode()) {
return;
}
this.targetExpandoButtonsOpen.setValue(1);
- this.setState({ buttonsExpanded: true });
+ this.props.setButtonsExpanded(true);
};
hideButtons() {
if (
ChatInputBar.mediaGalleryOpen(this.props) ||
!this.systemKeyboardShowing ||
- !this.state.buttonsExpanded
+ !this.props.buttonsExpanded
) {
return;
}
this.targetExpandoButtonsOpen.setValue(0);
- this.setState({ buttonsExpanded: false });
+ this.props.setButtonsExpanded(false);
}
immediatelyHideButtons() {
this.expandoButtonsOpen.setValue(0);
this.targetExpandoButtonsOpen.setValue(0);
- this.setState({ buttonsExpanded: false });
+ this.props.setButtonsExpanded(false);
}
showMediaGallery = () => {
@@ -1303,6 +1303,7 @@
const [text, setText] = React.useState(draft);
const [textEdited, setTextEdited] = React.useState(false);
+ const [buttonsExpanded, setButtonsExpanded] = React.useState(true);
const typeaheadRegexMatches = React.useMemo(
() =>
@@ -1390,6 +1391,8 @@
setText={setText}
textEdited={textEdited}
setTextEdited={setTextEdited}
+ buttonsExpanded={buttonsExpanded}
+ setButtonsExpanded={setButtonsExpanded}
/>
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 1:38 PM (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570909
Default Alt Text
D14007.id.diff (3 KB)
Attached To
Mode
D14007: [native] Move buttonsExpanded in ChatInputBar to function component
Attached
Detach File
Event Timeline
Log In to Comment