|
@@ -50,6 +50,10 @@ export default class PersonalInfoDialog extends Component<Props> {
|
|
|
placeholder: holder
|
|
|
});
|
|
|
}
|
|
|
+ cancel() {
|
|
|
+ let data = { updateNS_show: false };
|
|
|
+ this.props.updateParentState(data);
|
|
|
+ }
|
|
|
|
|
|
touchDown() {
|
|
|
this.setState({
|
|
@@ -75,27 +79,19 @@ export default class PersonalInfoDialog extends Component<Props> {
|
|
|
touch_cancel_textcolor: "#58A8FA"
|
|
|
});
|
|
|
}
|
|
|
- setParentState() {
|
|
|
+ setParentState(bool) {
|
|
|
let data;
|
|
|
if (this.state.updateType == 1) {
|
|
|
- data = { nickName: this.state.input_text };
|
|
|
+ data = { nickName: this.state.input_text, updateNS_show: bool };
|
|
|
} else if (this.state.updateType == 2) {
|
|
|
- data = { schoolName: this.state.input_text };
|
|
|
+ data = { schoolName: this.state.input_text, updateNS_show: bool };
|
|
|
}
|
|
|
this.props.updateParentState(data);
|
|
|
- this.setModalVisible(false);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
- return (
|
|
|
- <Modal
|
|
|
- animationType="fade"
|
|
|
- transparent={true}
|
|
|
- visible={this.state.modalVisible}
|
|
|
- onRequestClose={() => {
|
|
|
- this.setState({ modalVisible: false });
|
|
|
- }}
|
|
|
- >
|
|
|
+ if (this.props.updateNS_show) {
|
|
|
+ return (
|
|
|
<View
|
|
|
style={{
|
|
|
flex: 1,
|
|
@@ -104,7 +100,8 @@ export default class PersonalInfoDialog extends Component<Props> {
|
|
|
alignItems: "center",
|
|
|
justifyContent: "center",
|
|
|
backgroundColor: "rgba(0, 0, 0, 0.3)",
|
|
|
- flexDirection: "row"
|
|
|
+ flexDirection: "row",
|
|
|
+ position: "absolute"
|
|
|
}}
|
|
|
>
|
|
|
<View
|
|
@@ -187,7 +184,7 @@ export default class PersonalInfoDialog extends Component<Props> {
|
|
|
onPressIn={() => this.touchDown()}
|
|
|
onPressOut={() => this.touchUp()}
|
|
|
onPress={() => {
|
|
|
- this.setParentState();
|
|
|
+ this.setParentState(false);
|
|
|
}}
|
|
|
>
|
|
|
<Text
|
|
@@ -216,7 +213,7 @@ export default class PersonalInfoDialog extends Component<Props> {
|
|
|
activeOpacity={1}
|
|
|
onPressIn={() => this.touchCancelDown()}
|
|
|
onPressOut={() => this.touchCancelUp()}
|
|
|
- onPress={() => this.setModalVisible(false)}
|
|
|
+ onPress={() => this.cancel()}
|
|
|
>
|
|
|
<Text
|
|
|
style={{
|
|
@@ -236,7 +233,9 @@ export default class PersonalInfoDialog extends Component<Props> {
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- </Modal>
|
|
|
- );
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|