|
|
@ -1,20 +1,21 @@
|
|
|
|
// screens/moves/MoveFormScreen.tsx
|
|
|
|
// screens/moves/MoveFormScreen.tsx
|
|
|
|
|
|
|
|
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import { Button, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
|
|
import { Button, StyleSheet, Text, TextInput } from 'react-native';
|
|
|
|
import { StackNavigationProp } from '@react-navigation/stack';
|
|
|
|
import { StackNavigationProp } from '@react-navigation/stack';
|
|
|
|
import { RootStackParamList } from "../../navigation/navigationTypes";
|
|
|
|
import { RootStackParamList } from "../../navigation/navigationTypes";
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
import { createMove, updateMove } from '../../redux/actions/moveActions';
|
|
|
|
import { createMove, updateMove } from '../../redux/actions/moveActions';
|
|
|
|
import { AppDispatch } from "../../redux/store";
|
|
|
|
import { AppDispatch } from "../../redux/store";
|
|
|
|
import { Move } from "../../entities/Move";
|
|
|
|
import { Move } from "../../entities/Move";
|
|
|
|
import { RouteProp } from "@react-navigation/native";
|
|
|
|
import { RouteProp } from "@react-navigation/native";
|
|
|
|
import { MOVE_FORM } from "../../navigation/constants";
|
|
|
|
import { MOVE_FORM } from "../../navigation/constants";
|
|
|
|
import { Picker } from "@react-native-community/picker";
|
|
|
|
import { Picker } from "@react-native-community/picker";
|
|
|
|
import { ItemValue } from "@react-native-community/picker/typings/Picker";
|
|
|
|
import { ItemValue } from "@react-native-community/picker/typings/Picker";
|
|
|
|
import { MoveCategoryName } from "../../entities/MoveCategoryName";
|
|
|
|
import { MoveCategoryName } from "../../entities/MoveCategoryName";
|
|
|
|
import { TypeName } from "../../entities/TypeName";
|
|
|
|
import { TypeName } from "../../entities/TypeName";
|
|
|
|
import MultiSelect from "react-native-multiple-select";
|
|
|
|
import MultiSelect from "react-native-multiple-select";
|
|
|
|
|
|
|
|
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
|
|
|
|
|
|
|
|
|
|
type MoveFormScreenNavigationProp = StackNavigationProp<RootStackParamList, typeof MOVE_FORM>;
|
|
|
|
type MoveFormScreenNavigationProp = StackNavigationProp<RootStackParamList, typeof MOVE_FORM>;
|
|
|
|
type MoveFormScreenRouteProp = RouteProp<RootStackParamList, typeof MOVE_FORM>;
|
|
|
|
type MoveFormScreenRouteProp = RouteProp<RootStackParamList, typeof MOVE_FORM>;
|
|
|
@ -67,7 +68,7 @@ const MoveFormScreen = ({ navigation, route }: Props) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<View style={styles.container}>
|
|
|
|
<KeyboardAwareScrollView style={styles.container}>
|
|
|
|
<Text style={styles.label}>Name: </Text>
|
|
|
|
<Text style={styles.label}>Name: </Text>
|
|
|
|
<TextInput
|
|
|
|
<TextInput
|
|
|
|
value={move.name}
|
|
|
|
value={move.name}
|
|
|
@ -135,7 +136,8 @@ const MoveFormScreen = ({ navigation, route }: Props) => {
|
|
|
|
displayKey="name"
|
|
|
|
displayKey="name"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Button title="Save" onPress={handleSave}/>
|
|
|
|
<Button title="Save" onPress={handleSave}/>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
|
|
</KeyboardAwareScrollView>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|