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